'use client' import { Skeleton as HeroSkeleton } from '@heroui/react' import clsx from 'clsx' import { texts } from '@/texts' interface SkeletonProps { className?: string } export const Skeleton = ({ className }: SkeletonProps) => ( ) export const ListSkeleton = ({ count = 4, className }: { count?: number; className?: string }) => (
{Array.from({ length: count }).map((_, index) => (
))}
) export const DetailSkeleton = () => (
) const TABLE_SKELETON_CELL_WIDTHS = ['w-28', 'w-40', 'w-24', 'w-32', 'w-20', 'w-36'] as const interface TableSkeletonProps { columnCount?: number rows?: number showHeader?: boolean } export const TableSkeleton = ({ columnCount = 4, rows = 7, showHeader = true }: TableSkeletonProps) => { const cellCount = Math.max(1, columnCount) return (
{showHeader ? (
{Array.from({ length: cellCount }).map((_, index) => ( ))}
) : null} {Array.from({ length: rows }).map((_, rowIndex) => (
{Array.from({ length: cellCount }).map((_, cellIndex) => ( ))}
))}
) } /** Consumer route fallback with stable page chrome; intentionally contains no spinner. */ export const ConsumerRouteSkeleton = ({ className }: { className?: string }) => (
{Array.from({ length: 4 }).map((_, index) => (
))}
) export const PageLoading = ({ label = texts.common.preparingPage }: { label?: string }) => (

{label}

{texts.common.pleaseWait}

)