a818c110cf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
65 lines
2.2 KiB
TypeScript
65 lines
2.2 KiB
TypeScript
import {
|
||
ArrowLeftRight,
|
||
CalendarClock,
|
||
ChartColumn,
|
||
Coins,
|
||
House,
|
||
LayoutDashboard,
|
||
Package,
|
||
Settings,
|
||
ShoppingCart,
|
||
Tags,
|
||
Target,
|
||
UserCog,
|
||
Users,
|
||
Wallet,
|
||
type LucideIcon,
|
||
} from "lucide-react";
|
||
import { tr } from "@/i18n/tr";
|
||
|
||
export type NavItem = {
|
||
href: string;
|
||
label: string;
|
||
icon: LucideIcon;
|
||
/** Sayfanın ekleneceği faz; mevcut fazdan büyükse "Yakında" olarak pasif gösterilir. */
|
||
phase: number;
|
||
};
|
||
|
||
/** Şu an tamamlanmış en yüksek faz — sayfalar eklendikçe artar. */
|
||
/** Alt fazlar ondalıkla: 6.1 = Faz 6a. */
|
||
export const CURRENT_PHASE = 9.1;
|
||
|
||
export const isAvailable = (item: NavItem) => item.phase <= CURRENT_PHASE;
|
||
|
||
export const MAIN_NAV: NavItem[] = [
|
||
{ href: "/dashboard", label: tr.nav.dashboard, icon: LayoutDashboard, phase: 2 },
|
||
{ href: "/islemler", label: tr.nav.transactions, icon: ArrowLeftRight, phase: 6.2 },
|
||
{ href: "/hesaplar", label: tr.nav.accounts, icon: Wallet, phase: 6.1 },
|
||
{ href: "/kategoriler", label: tr.nav.categories, icon: Tags, phase: 6.1 },
|
||
{ href: "/planli", label: tr.nav.planned, icon: CalendarClock, phase: 7.1 },
|
||
{ href: "/cari", label: tr.nav.contacts, icon: Users, phase: 8.1 },
|
||
{ href: "/birikim", label: tr.nav.savings, icon: Coins, phase: 9.1 },
|
||
{ href: "/butce", label: tr.nav.budget, icon: Target, phase: 10 },
|
||
{ href: "/stok", label: tr.nav.stock, icon: Package, phase: 11 },
|
||
{ href: "/alisveris", label: tr.nav.shopping, icon: ShoppingCart, phase: 13 },
|
||
{ href: "/raporlar", label: tr.nav.reports, icon: ChartColumn, phase: 14 },
|
||
{ href: "/ayarlar", label: tr.nav.settings, icon: Settings, phase: 5 },
|
||
];
|
||
|
||
export const ADMIN_NAV: NavItem[] = [
|
||
{ href: "/admin/kullanicilar", label: tr.nav.adminUsers, icon: UserCog, phase: 2 },
|
||
{ href: "/admin/haneler", label: tr.nav.adminHouseholds, icon: House, phase: 5 },
|
||
];
|
||
|
||
/** Mobil alt menü: ortada Hızlı ekle, sağda "Daha fazla" (yan menüyü açar). */
|
||
const navByHref = (href: string) => MAIN_NAV.find((i) => i.href === href)!;
|
||
|
||
export const BOTTOM_NAV = {
|
||
left: [navByHref("/dashboard"), navByHref("/islemler")],
|
||
right: [navByHref("/butce")],
|
||
};
|
||
|
||
export function isActivePath(pathname: string, href: string) {
|
||
return pathname === href || pathname.startsWith(`${href}/`);
|
||
}
|