ConceptPortal-public/rsconcept/frontend/src/features/oss/components/oss-stats.tsx

61 lines
1.7 KiB
TypeScript
Raw Normal View History

2025-04-20 15:55:52 +03:00
import {
IconConceptBlock,
IconDownload,
IconRSForm,
IconRSFormImported,
IconRSFormOwned,
IconSynthesis
} from '@/components/icons';
import { cn } from '@/components/utils';
2025-03-12 12:04:50 +03:00
import { ValueStats } from '@/components/view';
import { type IOperationSchemaStats } from '../models/oss';
2024-07-26 00:34:08 +03:00
interface OssStatsProps {
2025-03-11 12:47:15 +03:00
className?: string;
2024-08-23 21:29:07 +03:00
stats: IOperationSchemaStats;
2024-07-26 00:34:08 +03:00
}
export function OssStats({ className, stats }: OssStatsProps) {
2024-07-26 00:34:08 +03:00
return (
2025-07-03 14:36:15 +03:00
<aside className={cn('grid grid-cols-4 gap-1 justify-items-end h-min select-none', className)}>
2024-08-23 21:29:07 +03:00
<div id='count_operations' className='w-fit flex gap-3 hover:cursor-default '>
<span>Всего</span>
2025-04-20 15:55:52 +03:00
<span>{stats.count_all}</span>
2024-08-23 21:29:07 +03:00
</div>
2025-06-18 16:14:41 +03:00
<ValueStats id='count_block' title='Блоки' icon={<IconConceptBlock size='1.25rem' />} value={stats.count_block} />
2024-08-23 21:29:07 +03:00
<ValueStats
id='count_inputs'
2025-03-20 14:42:01 +03:00
title='Загрузка'
2025-06-18 16:14:41 +03:00
icon={<IconDownload size='1.25rem' />}
2024-08-23 21:29:07 +03:00
value={stats.count_inputs}
/>
<ValueStats
id='count_synthesis'
2025-03-20 14:42:01 +03:00
title='Синтез'
2025-06-18 16:14:41 +03:00
icon={<IconSynthesis size='1.25rem' />}
2024-08-23 21:29:07 +03:00
value={stats.count_synthesis}
/>
2024-07-26 00:34:08 +03:00
2024-08-23 21:29:07 +03:00
<ValueStats
id='count_schemas'
2025-03-20 14:42:01 +03:00
title='Прикрепленные схемы'
2025-06-18 16:14:41 +03:00
icon={<IconRSForm size='1.25rem' />}
2024-08-23 21:29:07 +03:00
value={stats.count_schemas}
/>
<ValueStats
id='count_owned'
2025-03-20 14:42:01 +03:00
title='Собственные'
2025-06-18 16:14:41 +03:00
icon={<IconRSFormOwned size='1.25rem' />}
2024-08-23 21:29:07 +03:00
value={stats.count_owned}
/>
<ValueStats
id='count_imported'
2025-03-20 14:42:01 +03:00
title='Внешние'
2025-06-18 16:14:41 +03:00
icon={<IconRSFormImported size='1.25rem' />}
2024-08-23 21:29:07 +03:00
value={stats.count_schemas - stats.count_owned}
/>
2025-06-24 22:13:26 +03:00
</aside>
2024-07-26 00:34:08 +03:00
);
}