Portal/rsconcept/frontend/src/pages/OssPage/EditorOssCard/OssStats.tsx

59 lines
1.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import clsx from 'clsx';
import { IconDownload, IconRSForm, IconRSFormImported, IconRSFormOwned, IconSynthesis } from '@/components/Icons';
import ValueStats from '@/components/ui/ValueStats';
import { IOperationSchemaStats } from '@/models/oss';
interface OssStatsProps {
stats: IOperationSchemaStats;
}
function OssStats({ stats }: OssStatsProps) {
return (
<div
className={clsx(
'mt-3 md:ml-5 md:mt-8 md:w-[15rem] w-[20rem] h-min mx-auto', // prettier: split-lines
'grid grid-cols-3 gap-1 justify-items-end'
)}
>
<div id='count_operations' className='w-fit flex gap-3 hover:cursor-default '>
<span>Всего</span>
<span>{stats.count_operations}</span>
</div>
<ValueStats
id='count_inputs'
icon={<IconDownload size='1.25rem' className='clr-text-primary' />}
value={stats.count_inputs}
title='Загрузка'
/>
<ValueStats
id='count_synthesis'
icon={<IconSynthesis size='1.25rem' className='clr-text-primary' />}
value={stats.count_synthesis}
title='Синтез'
/>
<ValueStats
id='count_schemas'
icon={<IconRSForm size='1.25rem' className='clr-text-primary' />}
value={stats.count_schemas}
title='Прикрепленные схемы'
/>
<ValueStats
id='count_owned'
icon={<IconRSFormOwned size='1.25rem' className='clr-text-primary' />}
value={stats.count_owned}
title='Собственные'
/>
<ValueStats
id='count_imported'
icon={<IconRSFormImported size='1.25rem' className='clr-text-primary' />}
value={stats.count_schemas - stats.count_owned}
title='Внешние'
/>
</div>
);
}
export default OssStats;