import type { Meta, StoryObj } from '@storybook/angular';
import { applicationConfig, moduleMetadata } from '@storybook/angular';
import { provideRouter } from '@angular/router';
import { ApplicationListComponent } from './application-list.component';
import { ApplicationLinkComponent } from '@shared/ui/application-link/application-link.component';

const meta: Meta<ApplicationListComponent> = {
  title: 'Molecules/Application List',
  component: ApplicationListComponent,
  decorators: [
    applicationConfig({ providers: [provideRouter([])] }),
    moduleMetadata({ imports: [ApplicationLinkComponent] }),
  ],
  render: () => ({
    template: `
      <app-application-list>
        <app-application-link heading="Inschrijving" status="Stap 2 van 3" cta="Verder gaan" clickable="true" />
        <app-application-link heading="Herregistratie" status="Referentie 2024-00123 · ingediend op 12 mei 2024" />
        <app-application-link heading="Inschrijven" subtitle="Schrijf u in in het BIG-register." to="/registreren" />
      </app-application-list>`,
  }),
  parameters: {
    // Structural: app-application-link's host sits between the <ul> and its <li> —
    // fixed by the WP-11 markup rework. See docs/backlog/WP-11-markup-fidelity.md.
    a11y: { disable: true },
  },
};
export default meta;
type Story = StoryObj<ApplicationListComponent>;

export const Default: Story = {};
