import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; import { ScrollArea } from "@/components/ui/scroll-area"; import { cn } from "@/lib/utils"; import { CircleSmall, PlusIcon, SearchIcon } from "lucide-react"; import { useEffect, useState } from "react"; const dummyUser = [ { accountId: "dummy1", name: "더미1" }, { accountId: "test2", name: "테스트2" }, { accountId: "dummy3", name: "테스트3" }, { accountId: "test4", name: "더미4" } ] interface ParticipantPopoverProps { participantList: string[]; setParticipantList: (list: string[]) => void; } export const ParticipantPopover = ({ participantList, setParticipantList }: ParticipantPopoverProps) => { const [open, setOpen] = useState(false); const [filterString, setFilterString] = useState(''); const [userList, setUserList] = useState(dummyUser); const [tempList, setTempList] = useState(participantList); const updateTempList = (accountId: string) => { if (tempList.includes(accountId)) { setTempList(tempList.filter((id) => id !== accountId)); } else { setTempList([...tempList, accountId]); } } const applyList = () => { setParticipantList(tempList); setOpen(false); } const cancelList = () => { setOpen(false); setTimeout(() => { setTempList(participantList); }, 150); } return (