import { NavLink, useNavigate } from 'react-router-dom' import { Banknote, ClipboardList, BarChart2, Wallet, FileText, Settings, LogOut, ChevronRight, } from 'lucide-react' import type { User } from '../types' interface Props { user: User children: React.ReactNode } const navItems = [ { to: '/daily', label: 'Daily Cash Up', icon: Banknote }, { to: '/history', label: 'History', icon: ClipboardList }, { to: '/report', label: 'Weekly Report', icon: BarChart2 }, { to: '/floats', label: 'Float Management', icon: Wallet }, { to: '/summary', label: 'Cash Summary', icon: FileText }, { to: '/settings',label: 'Settings', icon: Settings }, ] export function Layout({ user, children }: Props) { const navigate = useNavigate() async function logout() { await fetch('/cashup/api/auth/logout', { method: 'POST', credentials: 'include' }) navigate('/login', { replace: true }) window.location.reload() } return (
{/* Sidebar */} {/* Content */}
{children}
) } export function PageHeader({ title, subtitle }: { title: string; subtitle?: string }) { return (

{title}

{subtitle &&

{subtitle}

}
) } export function Card({ children, style }: { children: React.ReactNode; style?: React.CSSProperties }) { return (
{children}
) } export function Btn({ children, onClick, variant = 'primary', disabled, small, type = 'button', style, }: { children: React.ReactNode onClick?: () => void variant?: 'primary' | 'secondary' | 'danger' | 'ghost' disabled?: boolean small?: boolean type?: 'button' | 'submit' style?: React.CSSProperties }) { const styles: Record = { primary: { background: 'var(--gold)', color: 'var(--navy-dark)', border: 'none' }, secondary: { background: 'var(--card-bg)', color: 'var(--text-dark)', border: '1px solid var(--card-border)' }, danger: { background: 'var(--danger)', color: '#fff', border: 'none' }, ghost: { background: 'transparent', color: 'var(--text-mid)', border: '1px solid var(--card-border)' }, } return ( ) } export function StatusBadge({ status }: { status: 'draft' | 'final' }) { const styles = { draft: { background: '#fef9c3', color: '#ca8a04' }, final: { background: '#dcfce7', color: '#16a34a' }, } return ( {status} ) }