import type { Meta, StoryObj } from '@storybook/angular';
import type { Upload } from '@shared/upload/upload.machine';
import { SingleUploadComponent } from './single-upload.component';

const meta: Meta<SingleUploadComponent> = {
  title: 'Design System/Molecules/SingleUpload',
  component: SingleUploadComponent,
  render: (args) => ({
    props: args,
    template: `<ul class="file-list"><li app-single-upload [upload]="upload"></li></ul>`,
  }),
};
export default meta;
type Story = StoryObj<SingleUploadComponent>;

const base: Upload = {
  localId: 'u-1',
  categoryId: 'diploma',
  fileName: 'diploma.pdf',
  fileSizeMb: 1.2,
  status: { type: 'complete', documentId: 'doc-1' },
  backgroundSync: false,
};

export const Complete: Story = { args: { upload: base } };

export const Uploading: Story = {
  args: { upload: { ...base, status: { type: 'uploading', progressPct: 60 } } },
};
