import React from 'react'; import { Space, Table, Tag } from 'antd'; const { Column, ColumnGroup } = Table; interface DataType { key: React.Key; firstName: string; lastName: string; age: number; address: string; tags: string[]; } const data: DataType[] = [ { key: '1', firstName: 'John', lastName: 'Brown', age: 32, address: 'New York No. 1 Lake Park', tags: ['nice', 'developer'], }, { key: '2', firstName: 'Jim', lastName: 'Green', age: 42, address: 'London No. 1 Lake Park', tags: ['loser'], }, { key: '3', firstName: 'Joe', lastName: 'Black', age: 32, address: 'Sydney No. 1 Lake Park', tags: ['cool', 'teacher'], }, ]; const App: React.FC = () => ( dataSource={data}> ( <> {tags.map((tag) => { let color = tag.length > 5 ? 'geekblue' : 'green'; if (tag === 'loser') { color = 'volcano'; } return ( {tag.toUpperCase()} ); })} )} /> ( Invite {record.lastName} Delete )} /> ); export default App;