mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-15 21:16:17 +02:00
20 lines
777 B
TypeScript
20 lines
777 B
TypeScript
import { generatePath } from 'react-router';
|
|
|
|
import { AppRoute } from '/@/renderer/router/routes';
|
|
import { LibraryItem } from '/@/shared/types/domain-types';
|
|
|
|
export const getTitlePath = (itemType: LibraryItem, id: string) => {
|
|
switch (itemType) {
|
|
case LibraryItem.ALBUM:
|
|
return generatePath(AppRoute.LIBRARY_ALBUMS_DETAIL, { albumId: id });
|
|
case LibraryItem.ALBUM_ARTIST:
|
|
return generatePath(AppRoute.LIBRARY_ALBUM_ARTISTS_DETAIL, { albumArtistId: id });
|
|
case LibraryItem.ARTIST:
|
|
return generatePath(AppRoute.LIBRARY_ARTISTS_DETAIL, { artistId: id });
|
|
case LibraryItem.GENRE:
|
|
return generatePath(AppRoute.LIBRARY_GENRES, { genreId: id });
|
|
default:
|
|
return null;
|
|
}
|
|
};
|