mirror of
https://github.com/SamyRai/turash.git
synced 2025-12-26 23:01:33 +00:00
53 lines
1.6 KiB
TypeScript
53 lines
1.6 KiB
TypeScript
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/Card.tsx';
|
|
import { CenteredContent } from '@/components/ui/CenteredContent.tsx';
|
|
import { Grid } from '@/components/ui/layout';
|
|
import { Heading, Text } from '@/components/ui/Typography.tsx';
|
|
|
|
type Props = {
|
|
totalConnections: number;
|
|
activeConnections: number;
|
|
potentialConnections: number;
|
|
connectionRate: number;
|
|
t: (key: string) => string;
|
|
};
|
|
|
|
const ConnectionAnalyticsSection = ({
|
|
totalConnections,
|
|
activeConnections,
|
|
potentialConnections,
|
|
connectionRate,
|
|
t,
|
|
}: Props) => {
|
|
return (
|
|
<Card>
|
|
<CardHeader>
|
|
<CardTitle>{t('analyticsDashboard.connections')}</CardTitle>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<Grid cols={{ md: 3 }} gap="md">
|
|
<CenteredContent>
|
|
<Heading level="h3" className="text-primary mb-1">
|
|
{totalConnections}
|
|
</Heading>
|
|
<Text variant="muted">{t('analyticsDashboard.totalConnections')}</Text>
|
|
</CenteredContent>
|
|
<CenteredContent>
|
|
<Heading level="h3" className="text-success mb-1">
|
|
{activeConnections}
|
|
</Heading>
|
|
<Text variant="muted">{t('analyticsDashboard.activeConnections')}</Text>
|
|
</CenteredContent>
|
|
<CenteredContent>
|
|
<Heading level="h3" className="text-warning mb-1">
|
|
{Math.round(connectionRate * 100)}%
|
|
</Heading>
|
|
<Text variant="muted">{t('analyticsDashboard.connectionRate')}</Text>
|
|
</CenteredContent>
|
|
</Grid>
|
|
</CardContent>
|
|
</Card>
|
|
);
|
|
};
|
|
|
|
export default ConnectionAnalyticsSection;
|