list.tsx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. 'use client'
  2. import Pagination, { type Props as PaginationProps } from '@/app/components/base/pagination'
  3. import type { FC } from 'react'
  4. import Button from '@/app/components/base/button'
  5. import cn from '@/utils/classnames'
  6. type PageListProps = {
  7. list: []
  8. pagination: PaginationProps
  9. onUpdate: () => void
  10. }
  11. const LogPageList: FC<PageListProps> = ({
  12. list = [],
  13. pagination,
  14. onUpdate,
  15. }) => {
  16. return (
  17. <div className='relative flex h-full w-full flex-col'>
  18. <div className='relative grow overflow-x-auto'>
  19. <table className={'mt-3 w-full min-w-[700px] max-w-full border-collapse border-0 text-sm'}>
  20. <thead className="h-8 border-b border-divider-subtle text-xs font-medium uppercase leading-8 text-text-tertiary">
  21. <tr>
  22. <td>训练语料数据集版本</td>
  23. <td>训练时间</td>
  24. <td>训练模型结果版本</td>
  25. <td className="w-[120px] text-center">操作</td>
  26. </tr>
  27. </thead>
  28. <tbody className="text-text-secondary">
  29. {list.map((item: any, index) => (
  30. <tr
  31. key={item.id}
  32. className={'h-8 border-b border-divider-subtle hover:bg-background-default-hover'}
  33. >
  34. <td>{item.version}</td>
  35. <td>{item.time}</td>
  36. <td>{item.version}</td>
  37. <td>
  38. <Button variant='ghost-accent' size='small' className={cn('shrink-0')}>
  39. 下载
  40. </Button>
  41. </td>
  42. </tr>
  43. ))}
  44. </tbody>
  45. </table>
  46. </div>
  47. {/* Show Pagination only if the total is more than the limit */}
  48. {pagination.total && (
  49. <Pagination
  50. {...pagination}
  51. className='w-full shrink-0 px-0 pb-0'
  52. />
  53. )}
  54. </div>
  55. )
  56. }
  57. export default LogPageList