import { useState } from "react"; import { X, Save } from "lucide-react"; import type { Pet } from "../mockData.js"; interface Props { pet?: Pet; onSave: (pet: Pet) => void; onCancel: () => void; } export function PetForm({ pet, onSave, onCancel }: Props) { const [name, setName] = useState(pet?.name ?? ""); const [breed, setBreed] = useState(pet?.breed ?? ""); const [weight, setWeight] = useState(pet?.weight ?? 0); const [notes, setNotes] = useState(pet?.allergies ?? ""); function handleSubmit(e: React.FormEvent) { e.preventDefault(); if (!pet) return; onSave({ ...pet, name, breed, weight, allergies: notes }); } return (