import { Head, Link } from '@inertiajs/react' import Form from './Form' import { <%= inertia_model_type %> } from './types' interface EditProps { <%= singular_table_name %>: <%= inertia_model_type %> } export default function Edit({ <%= singular_table_name %> }: EditProps) { return ( <>

Editing <%= human_name.downcase %>

={<%= singular_table_name %>} onSubmit={(form) => { form.transform((data) => ({ <%= singular_table_name %>: data })) <% if attributes.any?(&:attachments?) -%> form.post(`<%= js_resource_path %>`, { headers: { 'X-HTTP-METHOD-OVERRIDE': 'put' }, }) <% else -%> form.patch(`<%= js_resource_path %>`) <% end -%> }} submitText="Update <%= human_name %>" /> `} className="ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" > Show this <%= human_name.downcase %> Back to <%= human_name.pluralize.downcase %>
) }