- use-admin-hooks: LedgerOverview.journal, LedgerEntryRow, LedgerSellerDetail journal fields, useLedgerJournal. - new "دفتر روزنامه" sub-tab + admin.ledger.journal route. - ledger overview: journal-derived KPI row + recorded-vs-journal drift badge. - seller detail: journal-balance stat + journal history table. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
import { Link, Outlet, useLocation } from "@remix-run/react";
|
||
import { cn } from "~/lib/utils";
|
||
import { AdminPageTitle } from "~/components/admin/DataTable";
|
||
|
||
const TABS = [
|
||
{ label: "نمای کلی", to: "/admin/ledger", exact: true },
|
||
{ label: "برداشتها", to: "/admin/ledger/payouts" },
|
||
{ label: "تراکنشها", to: "/admin/ledger/transactions" },
|
||
{ label: "دفتر روزنامه", to: "/admin/ledger/journal" },
|
||
{ label: "فروشندگان", to: "/admin/ledger/sellers" },
|
||
];
|
||
|
||
export default function LedgerLayout() {
|
||
const loc = useLocation();
|
||
const active = (t: (typeof TABS)[number]) =>
|
||
t.exact ? loc.pathname === t.to : loc.pathname.startsWith(t.to);
|
||
|
||
return (
|
||
<div>
|
||
<AdminPageTitle>دفتر مالی</AdminPageTitle>
|
||
<div className="flex gap-1 mb-5 border-b border-WHITE3 overflow-x-auto hide-scrollbar">
|
||
{TABS.map((t) => (
|
||
<Link
|
||
key={t.to}
|
||
to={t.to}
|
||
prefetch="intent"
|
||
className={cn(
|
||
"px-4 py-2 text-[13.5px] font-semibold whitespace-nowrap border-b-2 -mb-px transition-colors",
|
||
active(t)
|
||
? "border-BLACK text-BLACK"
|
||
: "border-transparent text-GRAY hover:text-BLACK2"
|
||
)}
|
||
>
|
||
{t.label}
|
||
</Link>
|
||
))}
|
||
</div>
|
||
<Outlet />
|
||
</div>
|
||
);
|
||
}
|