Add click-to-edit pattern across all admin tables
Replace Actions columns with clickable rows that open edit modals directly. Delete is now an inline two-step confirm button in the edit modal footer. Games modal links to routes/bosses detail, route modal links to encounters, and boss modal has an Edit Team button. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,9 +7,11 @@ interface PokemonFormModalProps {
|
||||
onSubmit: (data: CreatePokemonInput | UpdatePokemonInput) => void
|
||||
onClose: () => void
|
||||
isSubmitting?: boolean
|
||||
onDelete?: () => void
|
||||
isDeleting?: boolean
|
||||
}
|
||||
|
||||
export function PokemonFormModal({ pokemon, onSubmit, onClose, isSubmitting }: PokemonFormModalProps) {
|
||||
export function PokemonFormModal({ pokemon, onSubmit, onClose, isSubmitting, onDelete, isDeleting }: PokemonFormModalProps) {
|
||||
const [pokeapiId, setPokeapiId] = useState(String(pokemon?.pokeapiId ?? ''))
|
||||
const [nationalDex, setNationalDex] = useState(String(pokemon?.nationalDex ?? ''))
|
||||
const [name, setName] = useState(pokemon?.name ?? '')
|
||||
@@ -37,6 +39,8 @@ export function PokemonFormModal({ pokemon, onSubmit, onClose, isSubmitting }: P
|
||||
onClose={onClose}
|
||||
onSubmit={handleSubmit}
|
||||
isSubmitting={isSubmitting}
|
||||
onDelete={onDelete}
|
||||
isDeleting={isDeleting}
|
||||
>
|
||||
<div>
|
||||
<label className="block text-sm font-medium mb-1">PokeAPI ID</label>
|
||||
|
||||
Reference in New Issue
Block a user