Vitron-Front/app/routes/admin.ledger.tsx
Arda Samadi 40052b7002 admin ledger: Slice 2c journal UI (derived balances + journal history)
- 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>
2026-07-25 13:24:06 +03:30

42 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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>
);
}