import AutoTooltip from '@/components/auto-tooltip'; import { OverlayScroller } from '@/components/overlay-scroller'; import { Tag } from 'antd'; import React from 'react'; import styled from 'styled-components'; const TagInner = styled(Tag)` border-radius: 12px; margin: 0; `; const Content = styled.div` display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; `; interface SelectedProps { maxHeight?: number; selectedList: { key: string; title: string }[]; onUnselect: ( key: string, newSelectedKeys: { key: string; title: string }[] ) => void; } const SelectedList: React.FC = ({ maxHeight, selectedList, onUnselect }) => { const handleOnUnselect = (key: string) => { const newSelectedKeys = selectedList.filter((item) => item.key !== key); onUnselect(key, newSelectedKeys); }; return ( {selectedList.map((item) => ( { e.preventDefault(); handleOnUnselect(item.key); }} closable > {item.title} ))} ); }; export default SelectedList;