import type { Meta, StoryObj } from '@storybook/angular';
import { LibraryPassage } from '@brief/domain/brief';
import { PassagePickerComponent } from './passage-picker.component';

const passages: LibraryPassage[] = [
  {
    passageId: 'p1',
    scope: 'global',
    sectionKey: 'aanhef',
    label: 'Standaard aanhef',
    version: 1,
    content: { paragraphs: [{ nodes: [{ type: 'text', text: 'Geachte heer/mevrouw,' }] }] },
  },
  {
    passageId: 'p2',
    scope: 'beroep',
    beroep: 'arts',
    sectionKey: 'aanhef',
    label: 'Aanhef, arts-specifiek',
    version: 1,
    content: { paragraphs: [{ nodes: [{ type: 'text', text: 'Geachte collega,' }] }] },
  },
];

const meta: Meta<PassagePickerComponent> = {
  title: 'Domein/Brief/Passage Picker',
  component: PassagePickerComponent,
  render: (args) => ({
    props: args,
    template: `<app-passage-picker [passages]="passages" (insert)="insert($event)" />`,
  }),
  args: { passages, insert: () => {} },
};
export default meta;
type Story = StoryObj<PassagePickerComponent>;

export const Default: Story = {};
