1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/elements/ItemsScrollerContainerElement.tsx
2022-10-26 23:46:06 +03:00

43 lines
1.3 KiB
TypeScript

import React, { FunctionComponent } from 'react';
const createScroller = ({ scrollerclassName, dataHorizontal, dataMousewheel, dataCenterfocus, id, className }: IProps) => ({
__html: `<div is="emby-scroller"
class="${scrollerclassName}"
${dataHorizontal}
${dataMousewheel}
${dataCenterfocus}
>
<div
is="emby-itemscontainer"
${id}
class="${className}"
>
</div>
</div>`
});
type IProps = {
scrollerclassName?: string;
dataHorizontal?: string;
dataMousewheel?: string;
dataCenterfocus?: string;
id?: string;
className?: string;
}
const ItemsScrollerContainerElement: FunctionComponent<IProps> = ({ scrollerclassName, dataHorizontal, dataMousewheel, dataCenterfocus, id, className }: IProps) => {
return (
<div
dangerouslySetInnerHTML={createScroller({
scrollerclassName: scrollerclassName,
dataHorizontal: dataHorizontal ? `data-horizontal="${dataHorizontal}"` : '',
dataMousewheel: dataMousewheel ? `data-mousewheel="${dataMousewheel}"` : '',
dataCenterfocus: dataCenterfocus ? `data-centerfocus="${dataCenterfocus}"` : '',
id: id ? `id='${id}'` : '',
className: className
})}
/>
);
};
export default ItemsScrollerContainerElement;