import type { Song } from "./client.svelte.js"; export type InfoItemType = | "artist" | "album" | "playlist" | "radio" | "song" | "share"; export type InfoItem = { type: InfoItemType; id: string; label: string; sourceId?: string; }; export const trackInfoItem = (track: Song, radio = false): InfoItem => { return { type: radio ? "radio" : "song", id: track.id, label: track.title, sourceId: track.sourceId, }; }; export const isInfoItemType = (type: string): type is InfoItemType => type === "artist" || type === "album" || type === "playlist" || type === "radio" || type === "song" || type === "share";