import { useMutation } from "@tanstack/react-query"; import { LinkApi } from "@/entities/link"; import { useAlertStore } from "@/shared/lib/use-alert-store"; import { Button } from "@common/components"; const QuickStartButton: React.FC<{ linkSn: string }> = ({ linkSn }) => { const { setMessage: alert } = useAlertStore((state) => state); const { mutateAsync: updateQuickStart } = useMutation({ mutationFn: (linkSn: string) => LinkApi.linkQuickStart(linkSn), onSuccess: (result) => { if (result === 'succ') { alert('즉시 실행 요청이 완료되었습니다.'); } else { alert('기존 요청이 실행 대기중입니다.'); } }, onError: () => { alert('즉시 실행 요청을 실패했습니다.'); }, }); return ( ); }; export default QuickStartButton;