import { type FormEvent, useState } from 'react' import type { BossBattle, CreateBossResultInput } from '../types/game' interface BossDefeatModalProps { boss: BossBattle onSubmit: (data: CreateBossResultInput) => void onClose: () => void isPending?: boolean } export function BossDefeatModal({ boss, onSubmit, onClose, isPending }: BossDefeatModalProps) { const [result, setResult] = useState<'won' | 'lost'>('won') const [attempts, setAttempts] = useState('1') const handleSubmit = (e: FormEvent) => { e.preventDefault() onSubmit({ bossBattleId: boss.id, result, attempts: Number(attempts) || 1, }) } return (
{boss.location}