import { MyButtons } from '@/common';
import { Modal } from 'antd';
import { useState } from 'react';
import SurveyResponsesList from '../components/SurveyResponsesList';

interface Props {
  releaseId: number;
}

export default function SurveyResponsesByRelease({ releaseId }: Props) {
  const [open, setOpen] = useState(false);

  return (
    <>
      <MyButtons.Default
        title="查看回收"
        size="small"
        type="link"
        onClick={() => setOpen(true)}
      />
      <Modal
        title="问卷回收详情"
        open={open}
        onCancel={() => setOpen(false)}
        footer={null}
        width="90%"
        style={{ top: 20 }}
        destroyOnClose
      >
        <div style={{ maxHeight: 'calc(100vh - 200px)', overflow: 'auto' }}>
          <SurveyResponsesList releaseId={releaseId} title="问卷回收" />
        </div>
      </Modal>
    </>
  );
}
