ConceptPortal-public/rsconcept/frontend/src/features/oss/components/oss-stats.tsx
Ivan 9da2ed751c
Some checks failed
Frontend CI / build (22.x) (push) Has been cancelled
Frontend CI / notify-failure (push) Has been cancelled
M: Multiple minor UI fixes
2025-07-03 17:24:59 +03:00

61 lines
1.7 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 {
IconConceptBlock,
IconDownload,
IconRSForm,
IconRSFormImported,
IconRSFormOwned,
IconSynthesis
} from '@/components/icons';
import { cn } from '@/components/utils';
import { ValueStats } from '@/components/view';
import { type IOperationSchemaStats } from '../models/oss';
interface OssStatsProps {
className?: string;
stats: IOperationSchemaStats;
}
export function OssStats({ className, stats }: OssStatsProps) {
return (
<aside className={cn('grid grid-cols-4 gap-1 justify-items-end h-min select-none', className)}>
<div id='count_operations' className='w-fit flex gap-3 hover:cursor-default '>
<span>Всего</span>
<span>{stats.count_all}</span>
</div>
<ValueStats id='count_block' title='Блоки' icon={<IconConceptBlock size='1.25rem' />} value={stats.count_block} />
<ValueStats
id='count_inputs'
title='Загрузка'
icon={<IconDownload size='1.25rem' />}
value={stats.count_inputs}
/>
<ValueStats
id='count_synthesis'
title='Синтез'
icon={<IconSynthesis size='1.25rem' />}
value={stats.count_synthesis}
/>
<ValueStats
id='count_schemas'
title='Прикрепленные схемы'
icon={<IconRSForm size='1.25rem' />}
value={stats.count_schemas}
/>
<ValueStats
id='count_owned'
title='Собственные'
icon={<IconRSFormOwned size='1.25rem' />}
value={stats.count_owned}
/>
<ValueStats
id='count_imported'
title='Внешние'
icon={<IconRSFormImported size='1.25rem' />}
value={stats.count_schemas - stats.count_owned}
/>
</aside>
);
}