25 lines
574 B
TypeScript
25 lines
574 B
TypeScript
import type { SanityImageSource } from "@sanity/image-url";
|
|
|
|
export type ArtistCardData = {
|
|
_id: string;
|
|
name?: string;
|
|
role?: string;
|
|
slug?: string;
|
|
image?: SanityImageSource;
|
|
};
|
|
|
|
export type ComposerCardData = {
|
|
_id: string;
|
|
name?: string;
|
|
sortKey?: string;
|
|
birthYear?: number;
|
|
deathYear?: number;
|
|
slug?: string;
|
|
image?: SanityImageSource;
|
|
};
|
|
|
|
export function formatYears(birthYear?: number, deathYear?: number): string {
|
|
if (birthYear && deathYear) return `${birthYear}\u2013${deathYear}`;
|
|
if (birthYear) return `${birthYear}`;
|
|
return "";
|
|
}
|