import type { InertiaForm } from '@inertiajs/vue3'; export function formErrors>( form: InertiaForm, key: keyof T | string, ): string[] { const error = form.errors[key as keyof typeof form.errors]; return error ? [error] : []; }