blob: 2e0ab6fdfa0766c65224c0b53a3f332d90488d42 [file] [log] [blame]
22301014356527a2025-06-09 17:46:56 +08001import React from 'react';
2import { Row, Col, Typography, Divider } from 'antd';
3import type { CategoryProps } from './types';
4import WorkCard from './WorkCard';
5
6const { Title } = Typography;
7
8const Category: React.FC<CategoryProps> = ({ section, artworks }) => {
9 // 如果没有作品,不渲染该分区
10 if (artworks.length === 0) {
11 return null;
12 }
13
14 return (
15 <div style={{ marginBottom: '48px' }}>
16 <Title level={2} style={{ marginBottom: '24px', color: '#1890ff' }}>
17 {section.name}
18 </Title>
19 <Divider style={{ margin: '16px 0 24px 0' }} />
20
21 <Row gutter={[16, 16]}>
22 {artworks.map((artwork) => (
23 <Col
24 key={artwork.id}
25 xs={24}
26 sm={12}
27 md={8}
28 lg={6}
29 xl={6}
30 >
31 <WorkCard artwork={artwork} />
32 </Col>
33 ))}
34 </Row>
35 </div>
36 );
37};
38
39export default Category;