RecentList.tsx 737 B

1234567891011121314151617181920212223242526272829
  1. import type { CSSProperties } from "react";
  2. import { theme } from "antd";
  3. import type { RecentItem as RecentItemType } from "../../../api/workspace";
  4. import RecentItem from "./RecentItem";
  5. type RecentListProps = {
  6. items: RecentItemType[];
  7. };
  8. export default function RecentList({ items }: RecentListProps) {
  9. const { token } = theme.useToken();
  10. const styles: Record<string, CSSProperties> = {
  11. list: {
  12. background: token.colorBgContainer,
  13. borderRadius: token.borderRadiusLG,
  14. border: `1px solid ${token.colorBorderSecondary}`,
  15. overflow: "hidden",
  16. },
  17. };
  18. return (
  19. <div style={styles.list}>
  20. {items.map((item) => (
  21. <RecentItem key={item.id} {...item} />
  22. ))}
  23. </div>
  24. );
  25. }