import type { Meta, StoryObj } from '@storybook/vue3'; import { ref } from 'vue'; import UploadedMedia from './UploadedMedia.vue'; import { MediaInput } from '~/components'; type Story = StoryObj; const meta: Meta = { title: 'Application/Upload/MediaInput', component: MediaInput, tags: ['file', 'file input', 'input', 'upload', 'media'], argTypes: { modelValue: { table: { disable: true } }, }, args: { limit: 3, disabled: false, highlightedLabel: 'Click to upload', label: 'or drag and drop', subLabel: 'Recommended: 800 x 800px', }, }; export const MediaInput_: Story = { render: args => ({ components: { MediaInput, UploadedMedia }, setup() { const attachments = ref([]); const deleteFile = (file: File) => { const idx = attachments.value.indexOf(file); if (idx > -1) { attachments.value.splice(idx, 1); } }; return { args, attachments, deleteFile }; }, template: `
`, }), }; export default meta;