"use client"; import { DataArtifact } from "@/components/data-artifact"; /** * Shared loading / empty / error states for the 0pt portal. * Mono, square, radius 0. One red accent per screen, used at most once * (the single EmptyState CTA). No fetching here — pure presentation. * * LoadingSkeleton: hairline rows with a slow left-to-right sweep (not pulsing * blobs). EmptyState: centered, generous air, faint DataArtifact "grid" motif. * ErrorState: terse interface voice + "Försök igen". */ /** Hairline shimmer rows — a slow sweep travels left→right across each bar. */ export function LoadingSkeleton({ rows = 5 }: { rows?: number }) { return (
laddar ·
{Array.from({ length: Math.max(1, rows) }).map((_, i) => (
))} Laddar innehåll
); } /** Nothing here yet — centered, lots of air, faint grid motif, one red CTA max. */ export function EmptyState({ title, line, ctaHref, ctaLabel, }: { title: string; line: string; ctaHref?: string; ctaLabel?: string; }) { return (

tomt

{title}

{line}

{ctaHref && ctaLabel ? ( {ctaLabel} → ) : null}
); } /** Something broke — interface voice, single retry. */ export function ErrorState({ title = "Något gick fel", onRetry, }: { title?: string; onRetry?: () => void; }) { return (

fel

{title}

Kunde inte hämta data. Ingen ändring sparad.

{onRetry ? ( ) : null}
); }