feat(dashboard): implement dashboard schemas and API integration
- Added Zod schemas for dashboard queries, entries, summaries, and companies.
- Created dashboard API functions for fetching summary, work, attention, activity, and companies data.
- Developed dashboard components including BlockState, DashboardDetailsDialog, and DashboardPage for rendering dashboard information.
- Implemented quick create functionality for companies, tickets, interventions, assets, and resources.
- Introduced a new ResourceDashboardReader for querying resource-related data.
- Added a StatisticCard component for displaying key performance indicators in the dashboard.
2026-10-08 11:27:27 +00:00
|
|
|
|
import type { ReactNode } from "react";
|
|
|
|
|
|
|
|
|
|
|
|
const TONES = {
|
|
|
|
|
|
teal: "bg-primary/5",
|
|
|
|
|
|
rose: "bg-destructive/5",
|
|
|
|
|
|
amber: "bg-amber-500/5",
|
|
|
|
|
|
green: "bg-emerald-500/5",
|
|
|
|
|
|
violet: "bg-violet-500/5",
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const ICON_TONES = {
|
|
|
|
|
|
teal: "text-primary",
|
|
|
|
|
|
rose: "text-destructive",
|
|
|
|
|
|
amber: "text-amber-700 dark:text-amber-400",
|
|
|
|
|
|
green: "text-emerald-700 dark:text-emerald-400",
|
|
|
|
|
|
violet: "text-violet-700 dark:text-violet-400",
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export function StatisticCard({
|
|
|
|
|
|
icon,
|
|
|
|
|
|
label,
|
|
|
|
|
|
value,
|
|
|
|
|
|
tone = "teal",
|
|
|
|
|
|
onClick,
|
|
|
|
|
|
status,
|
2026-10-09 19:01:55 +00:00
|
|
|
|
compact = false,
|
feat(dashboard): implement dashboard schemas and API integration
- Added Zod schemas for dashboard queries, entries, summaries, and companies.
- Created dashboard API functions for fetching summary, work, attention, activity, and companies data.
- Developed dashboard components including BlockState, DashboardDetailsDialog, and DashboardPage for rendering dashboard information.
- Implemented quick create functionality for companies, tickets, interventions, assets, and resources.
- Introduced a new ResourceDashboardReader for querying resource-related data.
- Added a StatisticCard component for displaying key performance indicators in the dashboard.
2026-10-08 11:27:27 +00:00
|
|
|
|
}: {
|
2026-10-09 19:01:55 +00:00
|
|
|
|
compact?: boolean;
|
feat(dashboard): implement dashboard schemas and API integration
- Added Zod schemas for dashboard queries, entries, summaries, and companies.
- Created dashboard API functions for fetching summary, work, attention, activity, and companies data.
- Developed dashboard components including BlockState, DashboardDetailsDialog, and DashboardPage for rendering dashboard information.
- Implemented quick create functionality for companies, tickets, interventions, assets, and resources.
- Introduced a new ResourceDashboardReader for querying resource-related data.
- Added a StatisticCard component for displaying key performance indicators in the dashboard.
2026-10-08 11:27:27 +00:00
|
|
|
|
icon: ReactNode;
|
|
|
|
|
|
label: string;
|
|
|
|
|
|
value?: number | undefined;
|
|
|
|
|
|
tone?: "teal" | "rose" | "amber" | "green" | "violet";
|
|
|
|
|
|
onClick: () => void;
|
|
|
|
|
|
status?: string | undefined;
|
|
|
|
|
|
}) {
|
|
|
|
|
|
return (
|
|
|
|
|
|
<button
|
2026-10-09 19:01:55 +00:00
|
|
|
|
className={`flex items-start gap-3 rounded-xl border border-border text-left transition-colors hover:border-primary focus-visible:outline-2 focus-visible:outline-ring ${compact ? "min-h-28 p-5" : "min-h-28 p-4 shadow-sm"} ${TONES[tone]}`}
|
feat(dashboard): implement dashboard schemas and API integration
- Added Zod schemas for dashboard queries, entries, summaries, and companies.
- Created dashboard API functions for fetching summary, work, attention, activity, and companies data.
- Developed dashboard components including BlockState, DashboardDetailsDialog, and DashboardPage for rendering dashboard information.
- Implemented quick create functionality for companies, tickets, interventions, assets, and resources.
- Introduced a new ResourceDashboardReader for querying resource-related data.
- Added a StatisticCard component for displaying key performance indicators in the dashboard.
2026-10-08 11:27:27 +00:00
|
|
|
|
onClick={onClick}
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
>
|
|
|
|
|
|
<span
|
|
|
|
|
|
aria-hidden="true"
|
|
|
|
|
|
className={`flex size-10 shrink-0 items-center justify-center rounded-full bg-background/60 [&_svg]:size-5 ${ICON_TONES[tone]}`}
|
|
|
|
|
|
>
|
|
|
|
|
|
{icon}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<span className="min-w-0">
|
2026-10-09 19:01:55 +00:00
|
|
|
|
<span
|
|
|
|
|
|
className={
|
|
|
|
|
|
compact
|
|
|
|
|
|
? "block text-sm font-medium text-foreground"
|
|
|
|
|
|
: "block text-xs font-medium text-foreground"
|
|
|
|
|
|
}
|
|
|
|
|
|
>
|
|
|
|
|
|
{label}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<strong
|
|
|
|
|
|
className={`mt-2 block font-semibold tabular-nums text-foreground ${compact ? "text-4xl tracking-tight" : "text-3xl"}`}
|
|
|
|
|
|
>
|
feat(dashboard): implement dashboard schemas and API integration
- Added Zod schemas for dashboard queries, entries, summaries, and companies.
- Created dashboard API functions for fetching summary, work, attention, activity, and companies data.
- Developed dashboard components including BlockState, DashboardDetailsDialog, and DashboardPage for rendering dashboard information.
- Implemented quick create functionality for companies, tickets, interventions, assets, and resources.
- Introduced a new ResourceDashboardReader for querying resource-related data.
- Added a StatisticCard component for displaying key performance indicators in the dashboard.
2026-10-08 11:27:27 +00:00
|
|
|
|
{value ?? "—"}
|
|
|
|
|
|
</strong>
|
|
|
|
|
|
{status && (
|
|
|
|
|
|
<small className="block mt-1 text-muted-foreground" role="status">
|
|
|
|
|
|
{status}
|
|
|
|
|
|
</small>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<span aria-hidden="true" className="ml-auto self-center text-lg text-primary">
|
|
|
|
|
|
›
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|