+
{row.label}
{row.valueText ?? formatNumber(row.value)}
-
+
- {row.sub &&
{row.sub}
}
+ {row.sub &&
{row.sub}
}
))}
{hidden > 0 && (
r.value === 0)
.map((r) => r.label)
.join(", ")}
>
+
{t("analytics.emptyRows", "+{{count}} görnüşde sargyt ýok", { count: hidden })}
)}
diff --git a/src/features/dashboard/components/productsCustomersSection.tsx b/src/features/dashboard/components/productsCustomersSection.tsx
index 211805f..df9f579 100644
--- a/src/features/dashboard/components/productsCustomersSection.tsx
+++ b/src/features/dashboard/components/productsCustomersSection.tsx
@@ -3,13 +3,12 @@ import { useTranslation } from "react-i18next";
import type { TFunction } from "i18next";
import { Info } from "lucide-react";
import { Cell, Pie, PieChart } from "recharts";
-import { Card, CardContent } from "@/components/ui/card";
import { getEducationLabel, getMarriageLabel } from "@/constants/formOptions";
-import { Skeleton } from "@/components/ui/skeleton";
import { ChartContainer, ChartTooltip, ChartTooltipContent } from "@/components/ui/chart";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
+import { cn } from "@/lib/utils";
import type { ApprovalCount, CountItem, CustomersData, ProductsData } from "../api/analyticsApi";
-import { BarList, EmptyState, SectionCard, type BarListRow } from "./analyticsShared";
+import { BarList, EmptyState, RegisterPanel, SectionCard, type BarListRow } from "./analyticsShared";
import { formatNumber, formatPercent, useLocalizedName } from "./analyticsFormat";
interface QueryProps
{
@@ -19,16 +18,31 @@ interface QueryProps {
onRetry: () => void;
}
-// One meaning per color across the dashboard: blue = loans, green = cards / good, amber = waiting, red = rejected.
+// One meaning per colour across the dashboard: teal = loans / approved,
+// mid teal = cards, light teal = secondary share, sand = waiting, clay = rejected.
const LOAN_COLOR = "var(--chart-1)";
const CARD_COLOR = "var(--chart-2)";
-const GOOD_COLOR = "var(--chart-2)";
+const SHARE_COLOR = "var(--chart-3)";
+const GOOD_COLOR = "var(--chart-1)";
const WAIT_COLOR = "var(--chart-4)";
const BAD_COLOR = "var(--chart-5)";
/** Below this many decided orders an approval rate is shown but flagged as unreliable. */
const MIN_DECIDED = 5;
+/** Shared 2×2 cell dividers: vertical rule + row rule, collapsing to stacked rows on mobile. */
+const CELL_BORDERS = [
+ "border-b border-border md:border-r",
+ "border-b border-border",
+ "border-b border-border md:border-b-0 md:border-r",
+ "border-b-0",
+];
+
+/** Donut geometry — the empty remainder is drawn as a static ring behind the chart. */
+const DONUT_SIZE = 164;
+const DONUT_INNER = 56;
+const DONUT_OUTER = 72;
+
/** "3 sargyt · 60%" — count first, share muted. */
function CountShare({ count, percent }: { count: number; percent: number }) {
const { t } = useTranslation();
@@ -42,12 +56,12 @@ function CountShare({ count, percent }: { count: number; percent: number }) {
);
}
-function InfoHint({ children }: { children: ReactNode }) {
+function InfoHint({ children, className }: { children: ReactNode; className?: string }) {
return (
-
-
+
+
{children}
@@ -66,7 +80,7 @@ interface DonutRow {
function TotalDonut({ items, rows: rowDefs }: { items: CountItem[]; rows: DonutRow[] }) {
const { t } = useTranslation();
const byKey = new Map(items.map((it) => [it.key, it]));
- // Fixed row order and colors, so "unpaid" is always amber and never swaps with "paid".
+ // Fixed row order and colors, so "unpaid" is always sand and never swaps with "paid".
const known = new Set(rowDefs.map((r) => r.key));
const extra = items.filter((it) => !known.has(it.key)).map((it) => ({ key: it.key, label: it.key, color: "var(--muted-foreground)" }));
const rows = [...rowDefs, ...extra].map((r) => ({
@@ -77,14 +91,36 @@ function TotalDonut({ items, rows: rowDefs }: { items: CountItem[]; rows: DonutR
const total = rows.reduce((s, r) => s + r.count, 0);
if (total === 0) return ;
const config = Object.fromEntries(rows.map((r) => [r.label, { label: r.label, color: r.color }]));
+ // Recharts derives its own slice angles; a pre-computed `percent` on the datum
+ // would be read as geometry, so the chart rows carry the count only.
+ const chartRows = rows.map(({ key, label, color, count }) => ({ key, label, color, count }));
+ const ringRadius = (DONUT_INNER + DONUT_OUTER) / 2;
return (
-
-
-
+
+
+
+
+
+
-
- {rows.map((r) => (
+
+ {chartRows.map((r) => (
|
))}
@@ -92,20 +128,20 @@ function TotalDonut({ items, rows: rowDefs }: { items: CountItem[]; rows: DonutR
- {formatNumber(total)}
+ {formatNumber(total)}
{t("analytics.kpi.orders", "sargyt")}
-
+
{rows.map((r) => (
-
-
-
- {r.label}
-
-
-
+
+
+
+ {r.label}
+
+ {formatNumber(r.count)} {formatNumber(r.percent, 1)}%
+
))}
@@ -118,7 +154,7 @@ function TotalDonut({ items, rows: rowDefs }: { items: CountItem[]; rows: DonutR
export function ProductsSection({ data, isLoading, isError, onRetry }: QueryProps
) {
const { t } = useTranslation();
const localized = useLocalizedName();
- const common = { isLoading, isError, onRetry, skeletonHeight: 150 };
+ const common = { isLoading, isError, onRetry, skeletonHeight: 170 };
const toRows = (items: ProductsData["loanTypes"]): BarListRow[] =>
items.map((it) => ({
@@ -130,60 +166,66 @@ export function ProductsSection({ data, isLoading, isError, onRetry }: QueryProp
}));
return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
);
}
// ─── Customers ────────────────────────────────────────────────────────────────
-/** Approved / rejected / waiting counts as colored dots, then the approval rate. */
+/** Approved / rejected / waiting counts as marked dots, then the approval rate. */
function Outcome({ item, t }: { item: ApprovalCount; t: TFunction }) {
const decided = item.approved + item.rejected;
const parts = [
{ n: item.approved, color: GOOD_COLOR, label: t("analytics.outcome.approved", "tassyklandy") },
{ n: item.rejected, color: BAD_COLOR, label: t("analytics.outcome.rejected", "ret edildi") },
- { n: item.open, color: WAIT_COLOR, label: t("analytics.outcome.open", "garaşýar") },
+ { n: item.open, color: WAIT_COLOR, label: t("analytics.outcome.open", "garaşýar"), pending: true },
].filter((p) => p.n > 0);
const fewData = decided > 0 && decided < MIN_DECIDED;
@@ -194,7 +236,11 @@ function Outcome({ item, t }: { item: ApprovalCount; t: TFunction }) {
{parts.map((p) => (
-
+
{formatNumber(p.n)} {p.label}
))}
@@ -214,7 +260,7 @@ function Outcome({ item, t }: { item: ApprovalCount; t: TFunction }) {
>
{formatPercent(item.approvalRate)}
-
+
{formatNumber(item.approved)}/{formatNumber(decided)}
@@ -241,62 +287,103 @@ function approvalRows(items: ApprovalCount[], labelFor: (key: string) => string,
}));
}
-function SummaryStat({ label, value, color, hint }: { label: string; value: string; color?: string; hint?: ReactNode }) {
+// ─── Anchor band: the five headline customer metrics on one dark surface ────
+
+function BandStat({ label, value, color, pending }: { label: string; value: string; color?: string; pending?: boolean }) {
return (
-
-
- {color && }
+
+
+ {color && (
+
+ )}
{label}
- {hint && {hint} }
-
{value}
+
{value}
);
}
function CustomersSummary({ data, isLoading }: { data?: CustomersData; isLoading: boolean }) {
const { t } = useTranslation();
+
+ // The endpoint reports totals per dimension but may omit the headline counts.
+ // When they are absent, ages are the one dimension that covers every applicant,
+ // so they are the honest source for the band.
+ const fromGroups = data?.ageGroups?.length
+ ? data.ageGroups.reduce(
+ (acc, g) => ({
+ approved: acc.approved + (g.approved ?? 0),
+ rejected: acc.rejected + (g.rejected ?? 0),
+ open: acc.open + (g.open ?? 0),
+ }),
+ { approved: 0, rejected: 0, open: 0 },
+ )
+ : undefined;
+
+ const approved = data?.approved ?? fromGroups?.approved;
+ const rejected = data?.rejected ?? fromGroups?.rejected;
+ const open = data?.open ?? fromGroups?.open;
+ const decided = (approved ?? 0) + (rejected ?? 0);
+ const approvalRate = data?.approvalRate ?? (decided > 0 ? ((approved ?? 0) / decided) * 100 : null);
+
+ const rateValue = formatPercent(approvalRate);
+ const width = typeof approvalRate === "number" ? `${Math.min(100, Math.max(0, approvalRate))}%` : "0%";
const rateHint = t(
"analytics.customers.approvalHint",
- "Tassyklama derejesi = tassyklanan ÷ (tassyklanan + ret edilen). Garaşýan sargytlar hasaba alynmaýar.",
+ "Tassyklama derejesi = tassyklanan ÷ (tasyklanan + ret edilen). Garaşýan sargytlar hasaba alynmaýar.",
);
+
return (
-
-
- {isLoading ? (
- Array.from({ length: 5 }, (_, i) => )
- ) : (
- <>
-
-
-
-
-
- >
- )}
-
-
+
+ {isLoading ? (
+
+ {Array.from({ length: 5 }, (_, i) => (
+
+ ))}
+
+ ) : (
+
+
+
+
+
+
+
+ {t("analytics.customers.approvalRate", "Tassyklama derejesi")}
+ {rateHint}
+
+
+ {rateValue}
+
+
+
+
+
+
+ )}
+
);
}
-export function CustomersSection({ data, isLoading, isError, onRetry }: QueryProps
) {
+interface CustomersSectionProps extends QueryProps {
+ /** Product breakdown is a sibling query, passed in so both blocks refresh together. */
+ products: QueryProps;
+}
+
+export function CustomersSection({ data, isLoading, isError, onRetry, products }: CustomersSectionProps) {
const { t } = useTranslation();
// One error card instead of four identical ones.
if (isError) {
- return ;
+ return (
+
+
+
+ );
}
const unknown = t("analytics.unknown", "Näbelli");
@@ -319,20 +406,34 @@ export function CustomersSection({ data, isLoading, isError, onRetry }: QueryPro
];
return (
-
-
-
- {t("analytics.customers.desc", "Saýlanan döwürde karz sargydyny berenleriň profili")}
-
-
-
-
- {cards.map((c) => (
-
-
-
- ))}
-
+
+
+
+
+
+
+
+
+ {t("analytics.customers.desc", "Saýlanan döwürde karz sargydyny berenleriň profili")}
+
+
+ {t("analytics.customers.approvalRate", "Tassyklama derejesi")}
+
+ {t(
+ "analytics.customers.approvalHint",
+ "Tassyklama derejesi = tassyklanan ÷ (tasyklanan + ret edilen). Garaşýan sargytlar hasaba alynmaýar.",
+ )}
+
+
+
+
+ {cards.map((c, i) => (
+
+
+
+ ))}
+
+
);
}
diff --git a/src/features/visaMasterPayments/components/PayDialog.tsx b/src/features/visaMasterPayments/components/PayDialog.tsx
index 921f19f..77813a0 100644
--- a/src/features/visaMasterPayments/components/PayDialog.tsx
+++ b/src/features/visaMasterPayments/components/PayDialog.tsx
@@ -179,6 +179,12 @@ function PayForm({ id, isPaying, onSubmit, onCancel }: PayFormProps) {
{quote.tvebFeeTmt} TMT
)}
+ {quote.maxAmountTmt != null && (
+
+
{t("intlPayment.pay.maxAmount", "Iň ýokary möçberi")}
+ {quote.maxAmountTmt} TMT
+
+ )}
) : null}
diff --git a/src/index.css b/src/index.css
index 101cfa6..51fb598 100644
--- a/src/index.css
+++ b/src/index.css
@@ -47,6 +47,11 @@
--color-card: var(--card);
--color-foreground: var(--foreground);
--color-background: var(--background);
+ --color-track: var(--track);
+ --color-positive: var(--positive);
+ --color-surface-strong: var(--surface-strong);
+ --color-surface-strong-foreground: var(--surface-strong-foreground);
+ --color-surface-strong-muted: var(--surface-strong-muted);
--radius-sm: calc(var(--radius) * 0.6);
--radius-md: calc(var(--radius) * 0.8);
--radius-lg: var(--radius);
@@ -54,6 +59,7 @@
--radius-2xl: calc(var(--radius) * 1.8);
--radius-3xl: calc(var(--radius) * 2.2);
--radius-4xl: calc(var(--radius) * 2.6);
+ --radius-panel: calc(var(--radius) * 1.1);
}
:root {
@@ -81,6 +87,12 @@
--chart-3: #7c3aed; /* registered — daha doygun mor */
--chart-4: #d97706; /* pending — daha koyu amber, açık zeminde okunaklı */
--chart-5: #dc2626; /* cancelled/rejected — daha koyu kırmızı */
+ /* Data-surface tokens (used by the dashboard scope below) */
+ --track: oklch(0.92 0.004 286.32);
+ --positive: #059669;
+ --surface-strong: #0b3634;
+ --surface-strong-foreground: #eff7f5;
+ --surface-strong-muted: #7ea8a2;
--radius: 0.625rem;
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.141 0.005 285.823);
@@ -125,6 +137,61 @@
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.552 0.016 285.938);
+ --link-color: #4cb2a1;
+}
+
+/* ─── Dashboard palette (scoped) ───────────────────────────────────────────────
+ The dashboard's tonal surface system lives here instead of in `:root`, so every
+ other page keeps the default theme. The tokens are applied by the
+ `.dashboard-surface` class on the dashboard route's .
+ Surfaces: the card sits one tonal step BELOW the page and carries no shadow,
+ so panels never glare against the canvas. Hues: teal = loans / approved,
+ mid teal = cards, light teal = secondary share, sand = waiting, clay = rejected.
+ ────────────────────────────────────────────────────────────────────────────── */
+
+html:not(.dark) .dashboard-surface {
+ --background: #f8fbfa;
+ --foreground: #0f211f;
+ --card: #eff5f4;
+ --card-foreground: #0f211f;
+ --popover: #ffffff;
+ --popover-foreground: #0f211f;
+ --primary: #0c7a6b;
+ --primary-foreground: #ffffff;
+ --secondary: #e6efed;
+ --secondary-foreground: #0f211f;
+ --muted: #e6efed;
+ --muted-foreground: #57706d;
+ --accent: #e6efed;
+ --accent-foreground: #0f211f;
+ --border: #dfe8e6;
+ --input: #dfe8e6;
+ --ring: #8ba19d;
+ --chart-1: #0c7a6b;
+ --chart-2: #3f8e80;
+ --chart-3: #7fb8ab;
+ --chart-4: #b58a4a;
+ --chart-5: #a05a48;
+ --track: #dbe6e3;
+ --positive: #0c7a6b;
+ --surface-strong: #0b3634;
+ --surface-strong-foreground: #eff7f5;
+ --surface-strong-muted: #7ea8a2;
+ --link-color: #0c7a6b;
+}
+
+.dark .dashboard-surface {
+ --chart-1: #4cb2a1;
+ --chart-2: #79c1b4;
+ --chart-3: #a5d5cc;
+ --chart-4: #d3ab72;
+ --chart-5: #c98a76;
+ --track: oklch(1 0 0 / 12%);
+ --positive: #4cb2a1;
+ --surface-strong: #103935;
+ --surface-strong-foreground: #e6f2f0;
+ --surface-strong-muted: #8fb8b2;
+ --link-color: #4cb2a1;
}
@layer base {
@@ -139,109 +206,6 @@
}
}
-/* ─── ProseMirror / Tiptap editor content styles ────────────────────────────
- Tailwind v4 preflight resets list-style, margins, and blockquote on all
- elements. We restore them explicitly so toolbar actions are visible.
- ─────────────────────────────────────────────────────────────────────────── */
-
-.ProseMirror {
- outline: none;
-}
-
-.ProseMirror > * + * {
- margin-top: 0.5rem;
-}
-
-/* ── Lists ── */
-.ProseMirror ul {
- list-style-type: disc;
- padding-left: 1.5rem;
- margin: 0.5rem 0;
-}
-
-.ProseMirror ol {
- list-style-type: decimal;
- padding-left: 1.5rem;
- margin: 0.5rem 0;
-}
-
-.ProseMirror li {
- margin: 0.2rem 0;
-}
-
-.ProseMirror li p {
- margin: 0;
-}
-
-/* ── Blockquote ── */
-.ProseMirror blockquote {
- border-left: 3px solid var(--border);
- padding-left: 1rem;
- color: var(--muted-foreground);
- font-style: italic;
- margin: 0.75rem 0;
-}
-
-/* ── Headings ── */
-.ProseMirror h1 {
- font-size: 1.5rem;
- font-weight: 700;
- margin: 0.75rem 0 0.25rem;
- line-height: 1.3;
-}
-
-.ProseMirror h2 {
- font-size: 1.25rem;
- font-weight: 600;
- margin: 0.75rem 0 0.25rem;
- line-height: 1.3;
-}
-
-.ProseMirror h3 {
- font-size: 1.1rem;
- font-weight: 600;
- margin: 0.75rem 0 0.25rem;
- line-height: 1.3;
-}
-
-/* ── Inline code ── */
-.ProseMirror code {
- background: var(--muted);
- border-radius: 0.25rem;
- padding: 0.1rem 0.35rem;
- font-size: 0.85em;
- font-family: ui-monospace, monospace;
-}
-
-/* ── Code block ── */
-.ProseMirror pre {
- background: var(--muted);
- border-radius: 0.375rem;
- padding: 0.75rem 1rem;
- overflow-x: auto;
- margin: 0.5rem 0;
-}
-
-.ProseMirror pre code {
- background: none;
- padding: 0;
- font-size: 0.85em;
-}
-
-/* ── Horizontal rule ── */
-.ProseMirror hr {
- border: none;
- border-top: 1px solid var(--border);
- margin: 0.75rem 0;
-}
-
-/* ── Links ── */
-.ProseMirror a {
- color: var(--primary);
- text-decoration: underline;
- cursor: pointer;
-}
-
/* ── Custom Scrollbar Styles ── */
.scrollbar-thin,
[data-slot="select-content"],
diff --git a/src/layouts/DashboardLayout.tsx b/src/layouts/DashboardLayout.tsx
index 9bef9da..914f47e 100644
--- a/src/layouts/DashboardLayout.tsx
+++ b/src/layouts/DashboardLayout.tsx
@@ -759,6 +759,11 @@ function DashboardHeader() {
// ─── Layout ───────────────────────────────────────────────────────────────────
export function DashboardLayout() {
+ const { pathname } = useLocation();
+ // The dashboard owns its own tonal palette (see `.dashboard-surface` in index.css);
+ // every other route keeps the default theme.
+ const isDashboardRoute = pathname.replace(/\/+$/, "").endsWith("/dashboard");
+
return (
@@ -768,7 +773,7 @@ export function DashboardLayout() {
-
+
diff --git a/src/pages/dashboard/index.tsx b/src/pages/dashboard/index.tsx
index b294034..79bd4f2 100644
--- a/src/pages/dashboard/index.tsx
+++ b/src/pages/dashboard/index.tsx
@@ -4,76 +4,87 @@ import { useMemo, useState, type ElementType } from "react";
import { useTranslation } from "react-i18next";
import { useQueryClient } from "@tanstack/react-query";
import { AlertCircle, ArrowDownRight, ArrowUpRight, CreditCard, DollarSign, FileText, RefreshCw, Users } from "lucide-react";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import { Skeleton } from "@/components/ui/skeleton";
import { Button } from "@/components/ui/button";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
+import { Skeleton } from "@/components/ui/skeleton";
import { cn } from "@/lib/utils";
import type { StatItem } from "@/features/dashboard/api/dashboardApi";
import { DASHBOARD_OVERVIEW_KEY, useDashboardOverview } from "@/features/dashboard/hooks/useDashboard";
-import { ANALYTICS_KEY, useAnalyticsCustomers } from "@/features/dashboard/hooks/useAnalytics";
+import { ANALYTICS_KEY, useAnalyticsCustomers, useAnalyticsProducts } from "@/features/dashboard/hooks/useAnalytics";
import { CustomersSection } from "@/features/dashboard/components/productsCustomersSection";
import { formatNumber } from "@/features/dashboard/components/analyticsFormat";
-// ─── Stat card ────────────────────────────────────────────────────────────────
+/**
+ * KPI register cell dividers: a 2×2 grid on small screens, one row of four on lg.
+ * Each cell owns its own rules, so the panel never needs a negative-margin trick.
+ */
+const KPI_CELL_BORDERS = [
+ "border-b border-r border-border lg:border-b-0",
+ "border-b border-border lg:border-b-0 lg:border-r",
+ "border-r border-border",
+ "",
+];
-interface StatCardProps {
+// ─── Stat cell ────────────────────────────────────────────────────────────────
+
+interface StatCellProps {
title: string;
stat?: StatItem;
icon: ElementType;
- accent: string;
footnote: string;
comparedTo: string;
+ className?: string;
}
-function StatCard({ title, stat, icon: Icon, accent, footnote, comparedTo }: StatCardProps) {
+function StatCell({ title, stat, icon: Icon, footnote, comparedTo, className }: StatCellProps) {
const change = stat?.changePercent;
const hasChange = change !== null && change !== undefined;
const positive = (change ?? 0) >= 0;
return (
-
-
- {title}
-
-
-
-
-
- {formatNumber(stat?.count ?? 0)}
- {hasChange ? (
-
- {positive ? : }
- {formatNumber(Math.abs(change), 1)}% {comparedTo}
-
- ) : (
-
-
- {footnote}
-
- )}
-
-
+
+
+
+
{formatNumber(stat?.count ?? 0)}
+
+ {hasChange ? (
+
+ {positive ? (
+
+ ) : (
+
+ )}
+ {formatNumber(Math.abs(change), 1)}%
+ {comparedTo}
+
+ ) : (
+
+
+ {footnote}
+
+ )}
+
);
}
-function StatCardSkeleton() {
+function StatCellSkeleton({ className }: { className?: string }) {
return (
-
-
-
-
-
-
-
-
-
-
+
);
}
@@ -89,8 +100,9 @@ export default function DashboardPage({ isLoading: propLoading = false }: { isLo
const overview = useDashboardOverview({ year: selectedYear });
const customers = useAnalyticsCustomers(analyticsParams);
+ const products = useAnalyticsProducts(analyticsParams);
- const isFetching = overview.isFetching || customers.isFetching;
+ const isFetching = overview.isFetching || customers.isFetching || products.isFetching;
const showStatSkeleton = propLoading || overview.isLoading;
const handleRefresh = () => {
@@ -102,78 +114,83 @@ export default function DashboardPage({ isLoading: propLoading = false }: { isLo
const comparedTo = t("dashboard.comparedToLastMonth", "geçen aýa garanyňda");
const stats = overview.data?.stats;
- const statCards: Omit[] = [
+ const statCards: Omit[] = [
{
title: t("dashboard.loanOrders", "Karz sargytlary"),
stat: stats?.loanOrders,
icon: FileText,
- accent: "bg-[var(--chart-1)]/12 text-[var(--chart-1)]",
footnote: t("dashboard.totalLoanOrders", "Jemi karz sargytlar"),
},
{
title: t("dashboard.activeCards", "Işjeň kartlar"),
stat: stats?.activeCards,
icon: CreditCard,
- accent: "bg-[var(--chart-3)]/12 text-[var(--chart-3)]",
footnote: t("dashboard.totalActiveCards", "Işjeň kartlaryň sany"),
},
{
title: t("dashboard.activeClients", "Işjeň müşderiler"),
stat: stats?.activeCustomers,
icon: Users,
- accent: "bg-[var(--chart-4)]/12 text-[var(--chart-4)]",
footnote: t("dashboard.totalActiveCustomers", "Hasaba alnan müşderiler"),
},
{
title: t("dashboard.onlinePayments", "Onlaýn tölegler"),
stat: stats?.onlinePayments,
icon: DollarSign,
- accent: "bg-[var(--chart-2)]/12 text-[var(--chart-2)]",
footnote: t("dashboard.totalOnlinePayments", "Amala aşyrylan tölegler"),
},
];
return (
-
+
{/* Header */}
-
+
-
{t("dashboard.title", "Baş sahypa")}
-
{t("dashboard.overviewSubtitle", "Ähli amallaryň gysgaça görünüşi")}
+
{t("dashboard.title", "Baş sahypa")}
+
{t("dashboard.overviewSubtitle", "Ähli amallaryň gysgaça görünüşi")}
-
+
setSelectedYear(Number(val))}>
-
-
+
+
+
+ {t("common.year", "ýyl")}
+
-
+
{yearOptions.map((y) => (
-
- {y} {t("common.year", "ýyl")}
+
+ {y}
))}
+
+
-
+
- {/* Stat cards */}
+ {/* KPI register */}
{overview.isError && !showStatSkeleton ? (
-
-
-
+
+
{t("dashboard.errorTitle", "Maglumatlary ýükläp bolmady")}
@@ -184,15 +201,15 @@ export default function DashboardPage({ isLoading: propLoading = false }: { isLo
overview.refetch()} variant="outline" className="gap-2">
-
+
{t("common.retry", "Täzeden synanyş")}
) : (
-
+
{showStatSkeleton
- ? Array.from({ length: 4 }, (_, i) => )
- : statCards.map((card) => )}
+ ? Array.from({ length: 4 }, (_, i) => )
+ : statCards.map((card, i) => )}
)}
@@ -202,6 +219,12 @@ export default function DashboardPage({ isLoading: propLoading = false }: { isLo
isLoading={customers.isLoading}
isError={customers.isError}
onRetry={() => customers.refetch()}
+ products={{
+ data: products.data,
+ isLoading: products.isLoading,
+ isError: products.isError,
+ onRetry: () => products.refetch(),
+ }}
/>
);