1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/components/dashboard/users/AccessContainer.tsx
2024-08-14 14:00:09 -04:00

57 lines
1.7 KiB
TypeScript

import React, { type FC, type PropsWithChildren } from 'react';
import globalize from '../../../lib/globalize';
import CheckBoxElement from '../../../elements/CheckBoxElement';
interface AccessContainerProps {
containerClassName?: string;
headerTitle?: string;
checkBoxClassName?: string;
checkBoxTitle?: string;
listContainerClassName?: string;
accessClassName?: string;
listTitle?: string;
description?: string;
}
const AccessContainer: FC<PropsWithChildren<AccessContainerProps>> = ({
containerClassName,
headerTitle,
checkBoxClassName,
checkBoxTitle,
listContainerClassName,
accessClassName,
listTitle,
description,
children
}) => {
return (
<div className={containerClassName}>
<h2>{globalize.translate(headerTitle)}</h2>
<CheckBoxElement
labelClassName='checkboxContainer'
className={checkBoxClassName}
title={checkBoxTitle}
/>
<div className={listContainerClassName}>
<div className={accessClassName}>
<h3 className='checkboxListLabel'>
{globalize.translate(listTitle)}
</h3>
<div
className='checkboxList paperList'
style={{
padding: '.5em 1em'
}}
>
{children}
</div>
</div>
<div className='fieldDescription'>
{globalize.translate(description)}
</div>
</div>
</div>
);
};
export default AccessContainer;