"use client";
import { DeviceAnalytics as DeviceAnalyticsType } from '../../api/types';
interface DeviceAnalyticsProps {
data: DeviceAnalyticsType;
}
function StatCard({ title, items }: { title: string; items: { name: string; count: number; percentage: number }[] }) {
return (
{title}
{items.map((item, index) => (
{item.name}
{item.count.toLocaleString()} ({item.percentage.toFixed(1)}%)
))}
);
}
export default function DeviceAnalytics({ data }: DeviceAnalyticsProps) {
return (
({
name: item.type.charAt(0).toUpperCase() + item.type.slice(1),
count: item.count,
percentage: item.percentage
}))}
/>
);
}