feat(playlists): библиотека плейлистов приложения

CRUD в редакторе, read-only окно на пульте, отдельный аудиоканал, экспорт/импорт и маппинг из Foundry.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Fontosh
2026-09-03 10:37:21 +08:00
parent cfb6e62331
commit 278eb78637
46 changed files with 2438 additions and 41 deletions
@@ -0,0 +1,19 @@
import { useEffect, useState } from 'react';
import { ipcChannels } from '../../../shared/ipc/contracts';
import type { PlaylistsState } from '../../../shared/types/appPlaylists';
import { getDndApi } from '../dndApi';
const EMPTY: PlaylistsState = { playlists: [], audios: [] };
export function useAppPlaylists(): PlaylistsState {
const api = getDndApi();
const [state, setState] = useState<PlaylistsState>(EMPTY);
useEffect(() => {
void api.invoke(ipcChannels.playlists.getState, {}).then(setState);
return api.on(ipcChannels.playlists.stateChanged, (next) => setState(next));
}, [api]);
return state;
}