'use client';
import { cn } from '@/lib/cn';
export function PageHeader({ title, subtitle, right }: { title: string; subtitle?: string; right?: React.ReactNode }) {
return (
{title}
{subtitle &&
{subtitle}
}
{right &&
{right}
}
);
}
export function Card({ className, children }: { className?: string; children: React.ReactNode }) {
return (
{children}
);
}
export function CardHeader({ icon: Icon, title, hint }: any) {
return (
{Icon && }
{title}
{hint && ยท {hint}}
);
}
export function Input({ label, ...props }: any) {
return (
);
}
export function Select({ label, children, ...props }: any) {
return (
);
}
export function Button({ variant = 'primary', size = 'md', className, children, ...props }: any) {
const variants: Record = {
primary: 'bg-blue-600 hover:bg-blue-700 text-white shadow-sm',
secondary: 'bg-slate-100 hover:bg-slate-200 text-slate-800 border border-slate-300',
ghost: 'bg-transparent hover:bg-slate-100 text-slate-700',
danger: 'bg-red-600 hover:bg-red-700 text-white',
};
const sizes: Record = {
sm: 'px-2.5 py-1 text-xs',
md: 'px-4 py-2 text-sm',
lg: 'px-5 py-2.5 text-base',
};
return (
);
}
export function Toggle({ checked, onChange, label }: any) {
return (
);
}
export function Banner({ level = 'info', children }: { level: 'info' | 'success' | 'warning' | 'danger'; children: React.ReactNode }) {
const styles: Record = {
info: 'bg-blue-50 border-blue-200 text-blue-800',
success: 'bg-green-50 border-green-200 text-green-800',
warning: 'bg-yellow-50 border-yellow-200 text-yellow-800',
danger: 'bg-red-50 border-red-200 text-red-800',
};
return (
{children}
);
}
export function Stat({ label, value, hint }: { label: string; value: any; hint?: string }) {
return (
{label}
{value}
{hint &&
{hint}
}
);
}