mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-19 13:33:35 +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>
54 lines
1.3 KiB
TypeScript
54 lines
1.3 KiB
TypeScript
import { FlatList } from 'react-native';
|
|
|
|
import type { Song } from '~/types';
|
|
import { formatDuration } from '~/services/audioService';
|
|
import { usePlayerStore } from '~/stores/playerStore';
|
|
|
|
import { Artwork } from './Artwork';
|
|
import { EmptyState } from './EmptyState';
|
|
import { ListItem } from './ListItem';
|
|
|
|
interface SongListProps {
|
|
songs: Song[];
|
|
onSongPress?: (song: Song, index: number) => void;
|
|
emptyTitle?: string;
|
|
emptyMessage?: string;
|
|
}
|
|
|
|
export function SongList({
|
|
songs,
|
|
onSongPress,
|
|
emptyTitle = 'Keine Songs',
|
|
emptyMessage = 'Importiere Songs über den + Button.',
|
|
}: SongListProps) {
|
|
const playSong = usePlayerStore((s) => s.playSong);
|
|
|
|
const handlePress = (song: Song, index: number) => {
|
|
if (onSongPress) {
|
|
onSongPress(song, index);
|
|
} else {
|
|
playSong(song, songs, index);
|
|
}
|
|
};
|
|
|
|
if (songs.length === 0) {
|
|
return <EmptyState title={emptyTitle} message={emptyMessage} />;
|
|
}
|
|
|
|
return (
|
|
<FlatList
|
|
data={songs}
|
|
keyExtractor={(item) => item.id}
|
|
renderItem={({ item, index }) => (
|
|
<ListItem
|
|
title={item.title}
|
|
subtitle={[item.artist, item.album].filter(Boolean).join(' · ')}
|
|
trailing={formatDuration(item.duration)}
|
|
left={<Artwork uri={item.coverArtPath} size={44} />}
|
|
onPress={() => handlePress(item, index)}
|
|
/>
|
|
)}
|
|
contentContainerStyle={{ paddingBottom: 100 }}
|
|
/>
|
|
);
|
|
}
|