2024-06-02 20:58:11 +03:00
|
|
|
import React, { type FC, type PropsWithChildren } from 'react';
|
2024-08-14 13:31:34 -04:00
|
|
|
import globalize from '../../../lib/globalize';
|
2022-06-29 18:26:33 +03:00
|
|
|
import CheckBoxElement from '../../../elements/CheckBoxElement';
|
2022-05-07 22:10:01 +03:00
|
|
|
|
2024-06-02 20:58:11 +03:00
|
|
|
interface AccessContainerProps {
|
2022-05-09 20:11:47 +03:00
|
|
|
containerClassName?: string;
|
|
|
|
headerTitle?: string;
|
|
|
|
checkBoxClassName?: string;
|
|
|
|
checkBoxTitle?: string;
|
|
|
|
listContainerClassName?: string;
|
|
|
|
accessClassName?: string;
|
|
|
|
listTitle?: string;
|
|
|
|
description?: string;
|
2024-06-02 20:58:11 +03:00
|
|
|
}
|
2022-05-07 22:10:01 +03:00
|
|
|
|
2024-06-02 20:58:11 +03:00
|
|
|
const AccessContainer: FC<PropsWithChildren<AccessContainerProps>> = ({
|
|
|
|
containerClassName,
|
|
|
|
headerTitle,
|
|
|
|
checkBoxClassName,
|
|
|
|
checkBoxTitle,
|
|
|
|
listContainerClassName,
|
|
|
|
accessClassName,
|
|
|
|
listTitle,
|
|
|
|
description,
|
|
|
|
children
|
|
|
|
}) => {
|
2022-05-07 22:10:01 +03:00
|
|
|
return (
|
2022-05-09 20:11:47 +03:00
|
|
|
<div className={containerClassName}>
|
|
|
|
<h2>{globalize.translate(headerTitle)}</h2>
|
2022-06-29 02:17:10 +03:00
|
|
|
<CheckBoxElement
|
|
|
|
labelClassName='checkboxContainer'
|
|
|
|
className={checkBoxClassName}
|
|
|
|
title={checkBoxTitle}
|
|
|
|
/>
|
2022-05-09 20:11:47 +03:00
|
|
|
<div className={listContainerClassName}>
|
|
|
|
<div className={accessClassName}>
|
2022-05-07 22:10:01 +03:00
|
|
|
<h3 className='checkboxListLabel'>
|
2022-05-09 20:11:47 +03:00
|
|
|
{globalize.translate(listTitle)}
|
2022-05-07 22:10:01 +03:00
|
|
|
</h3>
|
2024-06-02 20:58:11 +03:00
|
|
|
<div
|
|
|
|
className='checkboxList paperList'
|
|
|
|
style={{
|
|
|
|
padding: '.5em 1em'
|
|
|
|
}}
|
|
|
|
>
|
2022-05-07 22:10:01 +03:00
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className='fieldDescription'>
|
2022-05-09 20:11:47 +03:00
|
|
|
{globalize.translate(description)}
|
2022-05-07 22:10:01 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default AccessContainer;
|