import type { Meta, StoryObj } from '@storybook/angular'; import { LibraryPassage } from '@brief/domain/brief'; import { BesluitPanelComponent } from './besluit-panel.component'; const text = (t: string): LibraryPassage['content'] => ({ paragraphs: [{ nodes: [{ type: 'text', text: t }] }], }); const passages: LibraryPassage[] = [ { passageId: 'p-kern-positief', scope: 'global', sectionKey: 'kern', label: 'Toewijzing', version: 1, besluit: 'positief', content: text('Toegewezen.'), }, { passageId: 'p-kern-negatief', scope: 'global', sectionKey: 'kern', label: 'Afwijzing', version: 1, besluit: 'negatief', content: text('Afgewezen.'), }, { passageId: 'p-kern-scholing', scope: 'global', sectionKey: 'kern', label: 'Onvoldoende scholing', version: 1, besluit: 'negatief', reason: 'onvoldoende_scholing', content: text('Onvoldoende scholing.'), }, { passageId: 'p-kern-gegevens', scope: 'global', sectionKey: 'kern', label: 'Onjuiste gegevens', version: 1, besluit: 'negatief', reason: 'onjuiste_gegevens', content: text('Onjuiste gegevens.'), }, ]; const meta: Meta = { title: 'Domein/Brief/Besluit Panel', component: BesluitPanelComponent, args: { passages }, }; export default meta; type Story = StoryObj; /** Pick a besluit; a negatief besluit reveals the reason checkboxes. Each change emits `selectionChange` and the kern's standaardteksten follow live — no generate button. */ export const Default: Story = {}; /** Re-seeded from a persisted letter: a negatief besluit with a reden already ticked. */ export const NegatiefMetReden: Story = { args: { besluit: 'negatief', initialRedenen: ['onvoldoende_scholing'] }, };