import type { Meta, StoryObj } from '@storybook/angular';
import type { UploadStatus } from '@shared/upload/upload.machine';
import { DocumentChipComponent } from './document-chip.component';

const meta: Meta<DocumentChipComponent> = {
  title: 'Atoms/DocumentChip',
  component: DocumentChipComponent,
  render: (args) => ({
    props: args,
    template: `<app-document-chip [fileName]="fileName" [status]="status" [previewUrl]="previewUrl" />`,
  }),
};
export default meta;
type Story = StoryObj<DocumentChipComponent>;

export const Complete: Story = {
  args: { fileName: 'diploma.pdf', status: { type: 'complete', documentId: 'doc-1' } as UploadStatus },
};

export const WithPreview: Story = {
  args: { fileName: 'diploma.pdf', status: { type: 'complete', documentId: 'doc-1' } as UploadStatus, previewUrl: '/api/v1/uploads/doc-1/content' },
};

export const Failed: Story = {
  args: { fileName: 'diploma.pdf', status: { type: 'failed', reason: 'Netwerkfout' } as UploadStatus },
};
