/** * Skeleton placeholder for the shipments loading state. */ import { Spinner } from '@woocommerce/components'; import { Card, CardBody, Flex, FlexBlock, FlexItem, } from '@wordpress/components'; interface ShipmentsSkeletonProps { columns: number; } export default function ShipmentsSkeleton({ columns }: ShipmentsSkeletonProps) { const count = columns === 2 ? 4 : 3; const rows: number[][] = []; for (let i = 0; i < count; i += columns) { rows.push( Array.from( { length: Math.min(columns, count - i) }, (_, j) => i + j, ), ); } return ( {rows.map((row, rowIdx) => ( {row.map((i) => (
{[1, 2, 3, 4, 5].map((j) => ( ))} ))} ))} ); }