mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 04:50:36 +03:00
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import clsx from 'clsx';
|
|
|
|
import { useConceptOptions } from '@/context/ConceptOptionsContext';
|
|
import { CstClass } from '@/models/rsform';
|
|
import { colorBgCstClass } from '@/styling/color';
|
|
import { prefixes } from '@/utils/constants';
|
|
import { describeCstClass, labelCstClass } from '@/utils/labels';
|
|
|
|
interface InfoCstClassProps {
|
|
header?: string;
|
|
}
|
|
|
|
function InfoCstClass({ header }: InfoCstClassProps) {
|
|
const { colors } = useConceptOptions();
|
|
|
|
return (
|
|
<div className='flex flex-col gap-1 mb-2 dense'>
|
|
{header ? <h1>{header}</h1> : null}
|
|
{Object.values(CstClass).map((cstClass, index) => {
|
|
return (
|
|
<p key={`${prefixes.cst_status_list}${index}`}>
|
|
<span
|
|
className={clsx('inline-block', 'min-w-[7rem]', 'px-1', 'border', 'text-center text-sm font-controls')}
|
|
style={{ backgroundColor: colorBgCstClass(cstClass, colors) }}
|
|
>
|
|
{labelCstClass(cstClass)}
|
|
</span>
|
|
<span> - </span>
|
|
<span>{describeCstClass(cstClass)}</span>
|
|
</p>
|
|
);
|
|
})}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default InfoCstClass;
|