76 lines
1.6 KiB
TypeScript
76 lines
1.6 KiB
TypeScript
export interface Project {
|
|
id: string;
|
|
name: string;
|
|
daw: string;
|
|
bpm: string | number;
|
|
key: string;
|
|
status: string;
|
|
collaborators: number;
|
|
modified: string;
|
|
progress: number;
|
|
}
|
|
|
|
const MOCK_PROJECTS: Project[] = [
|
|
{
|
|
id: 'p1',
|
|
name: 'Neon Genesis',
|
|
daw: 'Ableton',
|
|
bpm: 128,
|
|
key: 'C Min',
|
|
status: 'In Progress',
|
|
collaborators: 2,
|
|
modified: '2h ago',
|
|
progress: 65,
|
|
},
|
|
{
|
|
id: 'p2',
|
|
name: 'Night City Drift',
|
|
daw: 'FL Studio',
|
|
bpm: 140,
|
|
key: 'F# Min',
|
|
status: 'Mixing',
|
|
collaborators: 0,
|
|
modified: '1d ago',
|
|
progress: 80,
|
|
},
|
|
{
|
|
id: 'p3',
|
|
name: 'Mainframe Breach',
|
|
daw: 'Logic Pro',
|
|
bpm: 174,
|
|
key: 'D Maj',
|
|
status: 'Mastering',
|
|
collaborators: 1,
|
|
modified: '3d ago',
|
|
progress: 95,
|
|
},
|
|
];
|
|
|
|
export const projectService = {
|
|
list: async () => {
|
|
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
return { projects: MOCK_PROJECTS };
|
|
},
|
|
|
|
get: async (id: string) => {
|
|
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
return {
|
|
project: MOCK_PROJECTS.find((p) => p.id === id) || MOCK_PROJECTS[0],
|
|
};
|
|
},
|
|
|
|
create: async (data: Partial<Project>) => {
|
|
await new Promise((resolve) => setTimeout(resolve, 800));
|
|
return { ...data, id: `new-${Date.now()}` } as Project;
|
|
},
|
|
|
|
update: async (id: string, data: Partial<Project>) => {
|
|
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
return { ...MOCK_PROJECTS[0], ...data, id } as Project;
|
|
},
|
|
|
|
delete: async (_id: string) => {
|
|
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
return { success: true };
|
|
},
|
|
};
|