import { FileNode } from '../types';

const MOCK_FILES: (FileNode & { tags: string[] })[] = [
  {
    id: '1',
    name: 'Vocals_Main.wav',
    type: 'audio',
    size: '24 MB',
    modified: '2023-10-25',
    status: 'ready',
    tags: ['Vocals', 'Raw'],
  },
  {
    id: '2',
    name: 'Project_Alpha_v3',
    type: 'folder',
    size: '-',
    modified: '2023-10-24',
    status: 'ready',
    tags: ['Project'],
  },
  {
    id: '3',
    name: 'Bass_Drop_F#m.wav',
    type: 'audio',
    size: '12 MB',
    modified: '2023-10-22',
    status: 'processing',
    tags: ['Bass', 'One-Shot'],
  },
  {
    id: '4',
    name: 'Album_Cover_Art.png',
    type: 'image',
    size: '4 MB',
    modified: '2023-10-15',
    status: 'ready',
    tags: ['Art', 'Final'],
  },
  {
    id: '5',
    name: 'Reference_Track_01.mp3',
    type: 'audio',
    size: '8 MB',
    modified: '2023-10-10',
    status: 'ready',
    tags: ['Reference'],
  },
  {
    id: '6',
    name: 'Legal_Contracts.pdf',
    type: 'document',
    size: '2 MB',
    modified: '2023-09-01',
    status: 'archived',
    tags: ['Legal'],
  },
  {
    id: '7',
    name: 'Drums_Stem_02.wav',
    type: 'audio',
    size: '45 MB',
    modified: '2023-10-25',
    status: 'ready',
    tags: ['Drums', 'Stem'],
  },
];

export const storageService = {
  listFiles: async (_folderId: string = 'root') => {
    await new Promise((resolve) => setTimeout(resolve, 400));
    return MOCK_FILES;
  },

  getFile: async (id: string) => {
    await new Promise((resolve) => setTimeout(resolve, 200));
    return MOCK_FILES.find((f) => f.id === id);
  },

  deleteFiles: async (_ids: string[]) => {
    await new Promise((resolve) => setTimeout(resolve, 500));
    return { success: true };
  },

  moveFiles: async (_ids: string[], _targetFolderId: string) => {
    await new Promise((resolve) => setTimeout(resolve, 500));
    return { success: true };
  },
};
