'use client'; import './style.scss'; import { useCallback } from 'react'; import { Copy } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; type Props = { isEnable: boolean; open: boolean; onChange: (open: boolean) => void; } export default function Copied({ isEnable, open, onChange }: Props) { const handleCopy = useCallback(async () => { try { await navigator.clipboard.writeText(window.location.href); alert("주소가 복사되었습니다."); onChange(false); } catch (err) { console.error("복사 실패:", err); } }, [onChange]); if (!isEnable) { return null; } return ( 주소 복사 이 주소를 복사하여 다른 곳에 붙여넣기 하세요.
); }