refactor(persons): extract inputCls/labelCls and PersonFormData type
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit was merged in pull request #333.
This commit is contained in:
@@ -3,6 +3,17 @@ import { m } from '$lib/paraglide/messages.js';
|
||||
export const PERSON_TYPES = ['PERSON', 'INSTITUTION', 'GROUP', 'UNKNOWN'] as const;
|
||||
export type PersonType = (typeof PERSON_TYPES)[number];
|
||||
|
||||
export type PersonFormData = {
|
||||
personType?: string | null;
|
||||
title?: string | null;
|
||||
firstName?: string | null;
|
||||
lastName: string;
|
||||
alias?: string | null;
|
||||
birthYear?: number | null;
|
||||
deathYear?: number | null;
|
||||
notes?: string | null;
|
||||
};
|
||||
|
||||
export function normalizePersonType(raw: string | undefined | null): PersonType {
|
||||
return raw === 'SKIP' ? 'UNKNOWN' : ((raw ?? 'PERSON') as PersonType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user