"use client" import type { ReactNode } from "react" import { usePathname } from "next/navigation" import { cn } from "@/lib/utils" import { TableCell, TableRow } from "@/components/ui/table" import { useI18n } from "@/i18n/provider" import { getPageTitleKey } from "@/lib/navigation" export function DashboardPage({ className, children, }: { className?: string children: ReactNode }) { const t = useI18n() const pathname = usePathname() const title = t(getPageTitleKey(pathname)) return (

{title}

{children}
) } export function DashboardToolbar({ className, actions, children, }: { className?: string actions?: ReactNode children: ReactNode }) { return (
{children}
{actions ? (
{actions}
) : null}
) } export function DashboardTableShell({ className, pagination, children, }: { className?: string pagination?: ReactNode children: ReactNode }) { return (
{children}
{pagination ?
{pagination}
: null}
) } export function DashboardTableStateRow({ colSpan, loading, loadingText, emptyText, }: { colSpan: number loading?: boolean loadingText?: string emptyText?: string }) { const t = useI18n() return ( {loading ? (loadingText ?? t("common.loadingData")) : (emptyText ?? t("common.emptyData"))} ) } export function DashboardTableSummary({ children, }: { children: ReactNode }) { return (
{children}
) }