import * as z from 'zod';

const Scenarios = z.array(z.object({
    scenario_id: z.int32(),
    name: z.string(),
    title: z.string(),
}));

export type Scenario = z.infer<typeof Scenarios>[number];

export async function scenarios(): Promise<Scenario[]> {
    const r = await fetch('/api/global/scenario');
    const u = await r.json();
    return Scenarios.parse(u);
}
