mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 20:21:09 +02:00
Combines LightWrite (beat/lyrics editor) and Mukke (iOS music player) into a single web-based music workspace app. Archives the old Mukke mobile app. - Rename: @lightwrite/* → @mukke/*, all branding, configs, Dockerfiles - New DB schemas: songs, playlists, playlist_songs + songId FK on projects - New backend modules: SongModule, PlaylistModule, LibraryModule - New web: app shell with sidebar, library (songs/albums/artists/genres), web player (queue/shuffle/repeat/MediaSession), playlists, search, upload, dashboard, album/artist/genre detail pages - Auth: add forgot-password + reset-password pages, extend auth store - Tests: 40 backend unit tests (song, playlist, library services) - Config: env generation, MinIO bucket, docker-compose prod, cloudflare - Docs: update CLAUDE.md, auth guidelines with SvelteKit checklist Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { Ionicons } from '@expo/vector-icons';
|
|
import { useState } from 'react';
|
|
import { Pressable, Alert } from 'react-native';
|
|
|
|
import { useTheme } from '~/utils/themeContext';
|
|
import { pickAndImportFiles } from '~/services/importService';
|
|
import { useLibraryStore } from '~/stores/libraryStore';
|
|
|
|
export function ImportButton() {
|
|
const { colors } = useTheme();
|
|
const [importing, setImporting] = useState(false);
|
|
const loadAll = useLibraryStore((s) => s.loadAll);
|
|
|
|
const handleImport = async () => {
|
|
if (importing) return;
|
|
setImporting(true);
|
|
try {
|
|
const songs = await pickAndImportFiles();
|
|
if (songs.length > 0) {
|
|
await loadAll();
|
|
Alert.alert('Importiert', `${songs.length} Song${songs.length > 1 ? 's' : ''} importiert.`);
|
|
}
|
|
} catch (error) {
|
|
console.error('Import failed:', error);
|
|
Alert.alert('Fehler', 'Beim Import ist ein Fehler aufgetreten.');
|
|
} finally {
|
|
setImporting(false);
|
|
}
|
|
};
|
|
|
|
return (
|
|
<Pressable onPress={handleImport} disabled={importing} style={{ padding: 8 }}>
|
|
<Ionicons name={importing ? 'hourglass' : 'add'} size={28} color={colors.primary} />
|
|
</Pressable>
|
|
);
|
|
}
|