import { A, useNavigate } from "@solidjs/router"; import { Show } from "solid-js"; import { CalendarView } from "../../components/dashboard/calendar-view"; import { RevenueChart } from "../../components/dashboard/revenue-chart"; import { KpiCard } from "../../components/dashboard/kpi-card"; import { ActivityTimeline } from "../../components/dashboard/activity-timeline"; import { NotificationDropdown } from "../../components/dashboard/notification-dropdown"; import { getInitials } from "../../components/dashboard/types"; import { ChevronRightIcon, MailIcon, SparklesIcon } from "../../components/dashboard/icons"; import { PinnedList } from "../../components/pinned-list"; import { DashboardLayout, useDashboardData } from "./layout"; function OverviewPage() { const data = useDashboardData(); const navigate = useNavigate(); return (
{/* Header */}

{data.i18n.t("dashboard.welcome")} {data.auth.session()?.user?.name}

{data.i18n.t("dashboard.overviewFor")} {data.resolvedBootstrap()?.tenantName}

{/* KPI Cards */}
{data.normalizedKpis().map((kpi: any, index: number) => ( ))}
{/* Setup Guide + Trend */}

{data.i18n.locale() === "cs" ? "Začínáme" : "Getting Started"}

{data.i18n.locale() === "cs" ? "Dokončete nastavení" : "Complete your setup"}

, href: "/dashboard/zones", }, { id: "setup-hours", name: data.i18n.locale() === "cs" ? "Nastavit provozní dobu" : "Set business hours", subtitle: data.i18n.locale() === "cs" ? "Po–Ne, svátky" : "Mon–Sun, holidays", icon: , href: "/dashboard/zones", }, { id: "setup-services", name: data.i18n.locale() === "cs" ? "Definovat služby" : "Define services", subtitle: data.i18n.locale() === "cs" ? "Ceník, délka, kapacita" : "Pricing, duration, capacity", icon: , href: "/dashboard/settings", }, { id: "setup-widget", name: data.i18n.locale() === "cs" ? "Vložit rezervační widget" : "Embed booking widget", subtitle: data.i18n.locale() === "cs" ? "Web, Instagram, email" : "Website, Instagram, email", icon: , href: "/dashboard/settings", }, { id: "setup-team", name: data.i18n.locale() === "cs" ? "Přidat členy týmu" : "Add team members", subtitle: data.i18n.locale() === "cs" ? "Role, oprávnění" : "Roles, permissions", icon: , href: "/dashboard/settings", }, { id: "setup-branding", name: data.i18n.locale() === "cs" ? "Upravit branding" : "Customize branding", subtitle: data.i18n.locale() === "cs" ? "Barva, logo, jazyk" : "Color, logo, language", icon: , href: "/dashboard/settings", }, ]} pinnedLabel={data.i18n.locale() === "cs" ? "Připnuto" : "Pinned"} allLabel={data.i18n.locale() === "cs" ? "Zbývá" : "Remaining"} initialPinned={["setup-locations"]} />
{/* SMS Usage */} {(() => { const usage = data.smsUsage(); if (!usage || usage.messageCount === 0) return null; return (

SMS {data.i18n.t("dashboard.billing.planUsage")}

{usage.messageCount} messages — {(usage.totalCostCents / 100).toFixed(2)} Kc

{data.i18n.t("dashboard.settings")}
); })()} {/* Plan Limit Warning */} {(() => { const entitlements = data.resolvedBilling()?.entitlements; const limit = entitlements?.maxLocations ?? -1; const count = data.locationData() ?? 0; const isNear = limit > 0 && count >= limit * 0.8; const isAt = limit > 0 && count >= limit; if (!isNear && !isAt) return null; return (

{isAt ? data.i18n.t("dashboard.locationLimitReached") : data.i18n.t("dashboard.nearingLocationLimit")}

{data.i18n.t("dashboard.locationsUsed")} {count}/{limit === -1 ? "\u221e" : limit}

); })()} {/* Calendar + Activity */}
{/* Upcoming Bookings */}

{data.i18n.t("dashboard.upcomingBookings")}

{data.normalizedUpcomingBookings().length} total

{data.i18n.t("dashboard.viewAll")}
{data.normalizedUpcomingBookings().slice(0, 5).map((booking: any) => ( ))}
); } export default function OverviewRoute() { return ( ); }