({ id, isOpen, closeModal }: DocumentModalProps)
| 20 | }; |
| 21 | |
| 22 | export function DocumentModal({ id, isOpen, closeModal }: DocumentModalProps) { |
| 23 | const { data: document } = useSuspenseQuery(documentQueryOptions.detail(id)); |
| 24 | |
| 25 | return ( |
| 26 | <Modal isOpen={isOpen} closeModal={closeModal}> |
| 27 | <Flex dir="col" gap={4} className="w-[80vw] md:w-[450px]"> |
| 28 | <Title3>자료실 다운로드</Title3> |
| 29 | <div className="h-[1.5px] bg-gray-200" /> |
| 30 | <Flex dir="col" gap={2} className="py-2"> |
| 31 | {document.files.map((item) => ( |
| 32 | <Flex |
| 33 | key={item.id} |
| 34 | alignItems="center" |
| 35 | justifyContent="between" |
| 36 | onClick={() => downloadFile(item.originUrl, item.name)} |
| 37 | className="cursor-pointer" |
| 38 | > |
| 39 | <Body2 weight="medium">{item.name}</Body2> |
| 40 | <Icon name="download" color="gray" size={20} /> |
| 41 | </Flex> |
| 42 | ))} |
| 43 | </Flex> |
| 44 | |
| 45 | <DoubleButton |
| 46 | left={ |
| 47 | <Button variant="tertiary" size="full" onClick={closeModal}> |
| 48 | <Body2>닫기</Body2> |
| 49 | </Button> |
| 50 | } |
| 51 | right={ |
| 52 | <Button |
| 53 | variant="primary" |
| 54 | color="blue" |
| 55 | size="full" |
| 56 | onClick={() => downloadAll(document.files)} |
| 57 | > |
| 58 | <Body2 weight="semibold">전체 다운로드</Body2> |
| 59 | </Button> |
| 60 | } |
| 61 | /> |
| 62 | </Flex> |
| 63 | </Modal> |
| 64 | ); |
| 65 | } |
nothing calls this directly
no test coverage detected