import React from "react"; import { Link } from "react-router-dom"; import { ISurvey } from "../types"; import { DuplicateIcon } from "../icons"; type Props = { survey: ISurvey; handleDelete: (id: string) => Promise; }; export const SurveyCard = ({ survey, handleDelete }: Props) => { const copyLink = async () => { await navigator.clipboard.writeText( `http://localhost:8080/answers/${survey._id}` ); alert("설문조사의 링크가 클립보드에 저장되었습니다."); }; const onDelete = async () => { survey._id && (await handleDelete(survey._id)); }; return (

{survey.title ? survey.title : "제목없는 설문조사"}

{survey.comment ? survey.comment : "설명없는 설문조사"}

{survey.updatedAt?.substring(0, 10)}

); };