import type { Meta, StoryObj } from '@storybook/react';
import { TrackEditDialog } from './TrackEditDialog';
import { Track } from '@/services/api';

const meta = {
  title: 'Features/Tracks/TrackEditDialog',
  component: TrackEditDialog,
  parameters: {
    layout: 'centered',
  },
  tags: ['autodocs'],
} satisfies Meta<typeof TrackEditDialog>;

export default meta;
type Story = StoryObj<typeof meta>;

const mockTrack: Track = {
  id: '1',
  title: 'Sample Track',
  artist: 'Sample Artist',
  album: 'Sample Album',
  duration: 180,
  format: 'mp3',
  size: 5242880, // 5MB
  createdAt: new Date().toISOString(),
  updatedAt: new Date().toISOString(),
  bitrate: 320,
  isPublic: false,
};

export const Default: Story = {
  args: {
    track: mockTrack,
    open: true,
    onOpenChange: () => {},
  },
};

export const PublicTrack: Story = {
  args: {
    track: {
      ...mockTrack,
      isPublic: true,
    },
    open: true,
    onOpenChange: () => {},
  },
};

export const HighQualityTrack: Story = {
  args: {
    track: {
      ...mockTrack,
      format: 'flac',
      bitrate: 1411,
      size: 52428800, // 50MB
    },
    open: true,
    onOpenChange: () => {},
  },
};

