import type { Meta, StoryObj } from '@storybook/angular';
import { Diagnostic } from '@brief/domain/placeholders';
import { DiagnosticsPanelComponent } from './diagnostics-panel.component';

const location = { blockId: 'local-2', paragraphIndex: 0, nodeIndex: 1 };

const errorAndWarning: Diagnostic[] = [
  {
    severity: 'error',
    code: 'unknown-placeholder',
    placeholderKey: 'onbekend_veld',
    location,
    message: 'Onbekend veld "onbekend_veld" — controleer de spelling.',
  },
  {
    severity: 'warning',
    code: 'unresolved-at-send',
    placeholderKey: 'reden_besluit',
    location,
    message: '"Reden besluit" is nog niet ingevuld.',
  },
];

const meta: Meta<DiagnosticsPanelComponent> = {
  title: 'Domein/Brief/Diagnostics Panel',
  component: DiagnosticsPanelComponent,
  args: { locate: () => {} },
};
export default meta;
type Story = StoryObj<DiagnosticsPanelComponent>;

export const Findings: Story = { args: { diagnostics: errorAndWarning } };
export const Clean: Story = { args: { diagnostics: [] } };
