ConceptPortal-public/rsconcept/frontend/src/components/Help/InfoCstStatus.tsx

30 lines
754 B
TypeScript
Raw Normal View History

2023-08-15 21:43:15 +03:00
import { prefixes } from '../../utils/constants';
import { mapStatusInfo } from '../../utils/staticUI';
2023-08-16 10:11:22 +03:00
interface InfoCstStatusProps {
2023-08-15 21:43:15 +03:00
title?: string
}
2023-08-16 10:11:22 +03:00
function InfoCstStatus({ title }: InfoCstStatusProps) {
2023-08-15 21:43:15 +03:00
return (
2023-08-16 00:39:16 +03:00
<div className='flex flex-col gap-1'>
2023-08-15 21:43:15 +03:00
{ title && <h1>{title}</h1>}
{ [... mapStatusInfo.values()].map(
(info, index) => {
return (
2023-08-16 00:39:16 +03:00
<p key={`${prefixes.cst_status_list}${index}`}>
<span className={`px-1 inline-block font-semibold min-w-[4rem] text-center border ${info.color}`}>
2023-08-15 21:43:15 +03:00
{info.text}
</span>
<span> - </span>
<span>
{info.tooltip}
</span>
</p>);
})}
2023-08-16 00:39:16 +03:00
</div>
2023-08-15 21:43:15 +03:00
);
}
2023-08-16 10:11:22 +03:00
export default InfoCstStatus;