forked from jellyfin/jellyfin-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathItemsScrollerContainerElement.tsx
More file actions
43 lines (39 loc) · 1.36 KB
/
Copy pathItemsScrollerContainerElement.tsx
File metadata and controls
43 lines (39 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import React, { FC } from 'react';
const createScroller = ({ scrollerclassName, dataHorizontal, dataMousewheel, dataCenterfocus, dataId, className }: IProps) => ({
__html: `<div is="emby-scroller"
class="${scrollerclassName}"
${dataHorizontal}
${dataMousewheel}
${dataCenterfocus}
>
<div
is="emby-itemscontainer"
class="${className}"
${dataId}
>
</div>
</div>`
});
interface IProps {
scrollerclassName?: string;
dataHorizontal?: string;
dataMousewheel?: string;
dataCenterfocus?: string;
dataId?: string;
className?: string;
}
const ItemsScrollerContainerElement: FC<IProps> = ({ scrollerclassName, dataHorizontal, dataMousewheel, dataCenterfocus, dataId, className }) => {
return (
<div
dangerouslySetInnerHTML={createScroller({
scrollerclassName: scrollerclassName,
dataHorizontal: dataHorizontal ? `data-horizontal="${dataHorizontal}"` : '',
dataMousewheel: dataMousewheel ? `data-mousewheel="${dataMousewheel}"` : '',
dataCenterfocus: dataCenterfocus ? `data-centerfocus="${dataCenterfocus}"` : '',
dataId: dataId ? `data-id="${dataId}"` : '',
className: className
})}
/>
);
};
export default ItemsScrollerContainerElement;