index.tsx 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import React from 'react'
  2. import {
  3. SkeletonContainer,
  4. SkeletonPoint,
  5. SkeletonRectangle,
  6. SkeletonRow,
  7. } from '@/app/components/base/skeleton'
  8. import Divider from '@/app/components/base/divider'
  9. const CardSkelton = React.memo(() => {
  10. return (
  11. <SkeletonContainer className='p-1 pb-2 gap-y-0'>
  12. <SkeletonContainer className='px-2 pt-1.5 gap-y-0.5'>
  13. <SkeletonRow className='py-0.5'>
  14. <SkeletonRectangle className='w-[72px] bg-text-quaternary' />
  15. <SkeletonPoint className='opacity-20' />
  16. <SkeletonRectangle className='w-24 bg-text-quaternary' />
  17. <SkeletonPoint className='opacity-20' />
  18. <SkeletonRectangle className='w-24 bg-text-quaternary' />
  19. <SkeletonRow className='grow justify-end gap-1'>
  20. <SkeletonRectangle className='w-12 bg-text-quaternary' />
  21. <SkeletonRectangle className='w-2 bg-text-quaternary mx-1' />
  22. </SkeletonRow>
  23. </SkeletonRow>
  24. <SkeletonRow className='py-0.5'>
  25. <SkeletonRectangle className='w-full bg-text-quaternary' />
  26. </SkeletonRow>
  27. <SkeletonRow className='py-0.5'>
  28. <SkeletonRectangle className='w-full bg-text-quaternary' />
  29. </SkeletonRow>
  30. <SkeletonRow className='py-0.5'>
  31. <SkeletonRectangle className='w-2/3 bg-text-quaternary' />
  32. </SkeletonRow>
  33. </SkeletonContainer>
  34. <SkeletonContainer className='px-2 py-1.5'>
  35. <SkeletonRow>
  36. <SkeletonRectangle className='w-14 bg-text-quaternary' />
  37. <SkeletonRectangle className='w-[88px] bg-text-quaternary' />
  38. <SkeletonRectangle className='w-14 bg-text-quaternary' />
  39. </SkeletonRow>
  40. </SkeletonContainer>
  41. </SkeletonContainer>
  42. )
  43. })
  44. CardSkelton.displayName = 'CardSkelton'
  45. const EmbeddingSkeleton = () => {
  46. return (
  47. <div className='relative flex flex-col grow overflow-y-hidden z-10'>
  48. <div className='absolute top-0 left-0 w-full h-full bg-dataset-chunk-list-mask-bg z-20' />
  49. {[...Array.from({ length: 5 })].map((_, index) => {
  50. return (
  51. <div key={index} className='w-full px-11'>
  52. <CardSkelton />
  53. {index !== 9 && <div className='w-full px-3'>
  54. <Divider type='horizontal' className='bg-divider-subtle my-1' />
  55. </div>}
  56. </div>
  57. )
  58. })}
  59. </div>
  60. )
  61. }
  62. export default React.memo(EmbeddingSkeleton)