- Add bulk XML CFDI upload support (up to 300MB) - Add period selector component for month/year navigation - Fix session persistence on page refresh (Zustand hydration) - Fix income/expense classification based on tenant RFC - Fix IVA calculation from XML (correct Impuestos element) - Add error handling to reportes page - Support multiple CORS origins - Update reportes service with proper Decimal/BigInt handling - Add RFC to tenant view store for proper CFDI classification - Update README with changelog and new features Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
53 lines
1.5 KiB
TypeScript
53 lines
1.5 KiB
TypeScript
'use client';
|
|
|
|
import { useThemeStore } from '@/stores/theme-store';
|
|
import { themes, type ThemeName } from '@/themes';
|
|
import { Button } from '@/components/ui/button';
|
|
import { TenantSelector } from '@/components/tenant-selector';
|
|
import { Sun, Moon, Palette } from 'lucide-react';
|
|
|
|
const themeIcons: Record<ThemeName, React.ReactNode> = {
|
|
light: <Sun className="h-4 w-4" />,
|
|
vibrant: <Palette className="h-4 w-4" />,
|
|
corporate: <Palette className="h-4 w-4" />,
|
|
dark: <Moon className="h-4 w-4" />,
|
|
};
|
|
|
|
const themeOrder: ThemeName[] = ['light', 'vibrant', 'corporate', 'dark'];
|
|
|
|
interface HeaderProps {
|
|
title: string;
|
|
children?: React.ReactNode;
|
|
}
|
|
|
|
export function Header({ title, children }: HeaderProps) {
|
|
const { theme, setTheme } = useThemeStore();
|
|
|
|
const cycleTheme = () => {
|
|
const currentIndex = themeOrder.indexOf(theme);
|
|
const nextIndex = (currentIndex + 1) % themeOrder.length;
|
|
setTheme(themeOrder[nextIndex]);
|
|
};
|
|
|
|
return (
|
|
<header className="sticky top-0 z-30 flex h-16 items-center justify-between border-b bg-background/95 backdrop-blur px-6">
|
|
<div className="flex items-center gap-4">
|
|
<h1 className="text-xl font-semibold">{title}</h1>
|
|
{children}
|
|
</div>
|
|
|
|
<div className="flex items-center gap-3">
|
|
<TenantSelector />
|
|
<Button
|
|
variant="ghost"
|
|
size="icon"
|
|
onClick={cycleTheme}
|
|
title={`Tema: ${themes[theme].name}`}
|
|
>
|
|
{themeIcons[theme]}
|
|
</Button>
|
|
</div>
|
|
</header>
|
|
);
|
|
}
|