import type { ReactNode } from "react"; import { AppButton } from "./AppButton"; import { AppText } from "./AppText"; export function AppSpinner() { return ; } export function AppSkeleton({ width = "100%", height = 12 }: { width?: string | number; height?: number }) { return ; } export function AppProgress({ spent, total, label, }: { spent: number; total: number; label?: string; }) { const pct = total > 0 ? Math.min(100, Math.max(0, (spent / total) * 100)) : 0; const tone = pct >= 100 ? "is-danger" : pct >= 85 ? "is-warn" : ""; return (
); } export function AppEmptyView({ title = "Пусто", message, action, }: { title?: string; message?: ReactNode; action?: ReactNode; }) { return (
{title} {message ? {message} : null} {action}
); } export function AppErrorView({ message, onRetry, }: { message: string; onRetry?: () => void; }) { return (
Не удалось загрузить {message} {onRetry ? ( ) : null}
); } export function AppChip({ label, selected = false, onClick, disabled, }: { label: string; selected?: boolean; onClick?: () => void; disabled?: boolean; }) { return ( ); } export function AppAvatar({ initials }: { initials: string }) { return {initials}; }