PublicationSkeleton.tsx 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { Switch, TableCell, TableRow } from 'ui'
  2. import { ShimmeringLoader } from 'ui-patterns/ShimmeringLoader'
  3. export interface PublicationSkeletonProps {
  4. index?: number
  5. }
  6. export const PublicationSkeleton = ({ index }: PublicationSkeletonProps) => {
  7. return (
  8. <TableRow>
  9. <TableCell style={{ width: '35%' }}>
  10. <ShimmeringLoader className="h-4 w-24 my-0.5 p-0" delayIndex={index} />
  11. </TableCell>
  12. <TableCell className="hidden lg:table-cell" style={{ width: '15%' }}>
  13. <ShimmeringLoader className="h-4 w-14 my-0.5 p-0" delayIndex={index} />
  14. </TableCell>
  15. {Array.from({ length: 4 }).map((_, i) => (
  16. <TableCell key={i}>
  17. <Switch size="small" checked={false} disabled={true} />
  18. </TableCell>
  19. ))}
  20. <TableCell className="px-4 py-3 pr-2">
  21. <div className="flex justify-end">
  22. <ShimmeringLoader className="h-6 w-12 p-0" delayIndex={index} />
  23. </div>
  24. </TableCell>
  25. </TableRow>
  26. )
  27. }
  28. export const PublicationTablesSkeleton = ({ index }: PublicationSkeletonProps) => {
  29. return (
  30. <TableRow>
  31. <TableCell style={{ width: '35%' }}>
  32. <ShimmeringLoader className="h-4 w-24 my-0.5 p-0" delayIndex={index} />
  33. </TableCell>
  34. <TableCell className="hidden lg:table-cell" style={{ width: '15%' }}>
  35. <ShimmeringLoader className="h-4 w-14 my-0.5 p-0" delayIndex={index} />
  36. </TableCell>
  37. <TableCell className="px-4 py-3 pr-2">
  38. <div className="flex">
  39. <ShimmeringLoader className="h-6 w-12 p-0" delayIndex={index} />
  40. </div>
  41. </TableCell>
  42. </TableRow>
  43. )
  44. }