2023-08-27 00:19:19 +03:00
|
|
|
import { useConceptTheme } from '../../context/ThemeContext';
|
2023-09-21 14:58:01 +03:00
|
|
|
import { CstClass } from '../../models/rsform';
|
|
|
|
import { colorbgCstClass } from '../../utils/color';
|
2023-08-16 00:39:16 +03:00
|
|
|
import { prefixes } from '../../utils/constants';
|
2023-09-21 14:58:01 +03:00
|
|
|
import { describeCstClass, labelCstClass } from '../../utils/labels';
|
2023-08-16 00:39:16 +03:00
|
|
|
|
2023-08-16 10:11:22 +03:00
|
|
|
interface InfoCstClassProps {
|
2023-08-16 00:39:16 +03:00
|
|
|
title?: string
|
|
|
|
}
|
|
|
|
|
2023-08-16 10:11:22 +03:00
|
|
|
function InfoCstClass({ title }: InfoCstClassProps) {
|
2023-08-27 00:19:19 +03:00
|
|
|
const { colors } = useConceptTheme();
|
|
|
|
|
2023-08-16 00:39:16 +03:00
|
|
|
return (
|
2023-11-27 11:33:34 +03:00
|
|
|
<div className='flex flex-col gap-1 mb-2'>
|
|
|
|
{title ? <h1>{title}</h1> : null}
|
|
|
|
{Object.values(CstClass).map(
|
|
|
|
(cclass, index) => {
|
|
|
|
return (
|
|
|
|
<p key={`${prefixes.cst_status_list}${index}`}>
|
|
|
|
<span
|
|
|
|
className='px-1 inline-block font-semibold min-w-[7rem] text-center border text-sm small-caps'
|
|
|
|
style={{backgroundColor: colorbgCstClass(cclass, colors)}}
|
|
|
|
>
|
|
|
|
{labelCstClass(cclass)}
|
|
|
|
</span>
|
|
|
|
<span> - </span>
|
|
|
|
<span>
|
|
|
|
{describeCstClass(cclass)}
|
|
|
|
</span>
|
|
|
|
</p>);
|
|
|
|
})}
|
|
|
|
</div>);
|
2023-08-16 00:39:16 +03:00
|
|
|
}
|
|
|
|
|
2023-08-16 10:11:22 +03:00
|
|
|
export default InfoCstClass;
|