28 lines
625 B
TypeScript
28 lines
625 B
TypeScript
export const CARD_TYPES = [
|
|
"rating_explained",
|
|
"international_ratings",
|
|
] as const;
|
|
|
|
export type CardType = (typeof CARD_TYPES)[number];
|
|
|
|
export interface CardMeta {
|
|
title: string;
|
|
subtitle: string;
|
|
badge?: string;
|
|
}
|
|
|
|
export const CARD_META: Record<CardType, CardMeta> = {
|
|
rating_explained: {
|
|
title: "Rating Explained",
|
|
subtitle: "Why this film has its age rating",
|
|
},
|
|
international_ratings: {
|
|
title: "International Ratings",
|
|
subtitle: "How ratings differ by country",
|
|
},
|
|
};
|
|
|
|
export function isCardType(value: string): value is CardType {
|
|
return CARD_TYPES.includes(value as CardType);
|
|
}
|