2022-10-02 19:07:42 +03:00
|
|
|
import React, { FC } from 'react';
|
2022-08-07 02:33:25 +03:00
|
|
|
|
2022-10-29 02:07:24 +03:00
|
|
|
const createScroller = ({ scrollerclassName, dataHorizontal, dataMousewheel, dataCenterfocus, dataId, className }: IProps) => ({
|
2022-08-07 02:33:25 +03:00
|
|
|
__html: `<div is="emby-scroller"
|
|
|
|
class="${scrollerclassName}"
|
|
|
|
${dataHorizontal}
|
|
|
|
${dataMousewheel}
|
|
|
|
${dataCenterfocus}
|
|
|
|
>
|
2022-10-02 19:07:42 +03:00
|
|
|
<div
|
|
|
|
is="emby-itemscontainer"
|
|
|
|
class="${className}"
|
2022-10-29 02:07:24 +03:00
|
|
|
${dataId}
|
2022-10-02 19:07:42 +03:00
|
|
|
>
|
|
|
|
</div>
|
2022-08-07 02:33:25 +03:00
|
|
|
</div>`
|
|
|
|
});
|
|
|
|
|
2022-10-02 19:07:42 +03:00
|
|
|
interface IProps {
|
2022-08-07 02:33:25 +03:00
|
|
|
scrollerclassName?: string;
|
|
|
|
dataHorizontal?: string;
|
|
|
|
dataMousewheel?: string;
|
|
|
|
dataCenterfocus?: string;
|
2022-10-29 02:07:24 +03:00
|
|
|
dataId?: string;
|
2022-08-07 02:33:25 +03:00
|
|
|
className?: string;
|
|
|
|
}
|
|
|
|
|
2022-10-29 02:07:24 +03:00
|
|
|
const ItemsScrollerContainerElement: FC<IProps> = ({ scrollerclassName, dataHorizontal, dataMousewheel, dataCenterfocus, dataId, className }) => {
|
2022-08-07 02:33:25 +03:00
|
|
|
return (
|
|
|
|
<div
|
|
|
|
dangerouslySetInnerHTML={createScroller({
|
|
|
|
scrollerclassName: scrollerclassName,
|
|
|
|
dataHorizontal: dataHorizontal ? `data-horizontal="${dataHorizontal}"` : '',
|
|
|
|
dataMousewheel: dataMousewheel ? `data-mousewheel="${dataMousewheel}"` : '',
|
|
|
|
dataCenterfocus: dataCenterfocus ? `data-centerfocus="${dataCenterfocus}"` : '',
|
2022-10-29 02:07:24 +03:00
|
|
|
dataId: dataId ? `data-id="${dataId}"` : '',
|
2022-08-07 02:33:25 +03:00
|
|
|
className: className
|
|
|
|
})}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ItemsScrollerContainerElement;
|