import useOverlayScroller from '@/hooks/use-overlay-scroller'; import { useIntl } from '@umijs/max'; import { Button, Modal, Typography } from 'antd'; import React from 'react'; import 'simplebar-react/dist/simplebar.min.css'; import promptList from '../config/prompt'; import '../style/prompt-modal.less'; type ViewModalProps = { open: boolean; onCancel: () => void; onSelect: (list: { role: string; content: string }[]) => void; }; const AddWorker: React.FC = (props) => { const { open, onCancel } = props || {}; const intl = useIntl(); const { initialize } = useOverlayScroller(); const scrollerRef = React.useRef(null); React.useEffect(() => { if (scrollerRef.current) { initialize(scrollerRef.current); } }, [scrollerRef.current, initialize]); const handleSelect = (item: { title: string; data: { role: string; content: string }[]; }) => { props.onSelect(item.data); onCancel(); }; return (
{promptList.map((item, index) => { return (

{item.title}

{item.data.map((data, i) => { return (
{data.role} {data.content}
); })}
); })}
); }; export default React.memo(AddWorker);