// The DJ platforms' marks, for the collection picker and anywhere else a // library's platform is named. Redrawn as geometry from each platform's app icon // (not traced), single-colour via `currentColor` so they take the theme's text // colour; the square app-icon backgrounds are left to whatever tile holds them. // // These are the platforms' trademarks, used to say which platform is which. // // A lookup of display ASSETS keyed by platform id — not behaviour branching on // the platform, which components must never do. An unknown id falls back to a // generic mark, so a new adapter shows up without touching this file. import { useId } from 'react' import { Icon } from './icons' type Mark = (props: { mask: string }) => React.ReactElement const MARKS: Record = { // An outer ring around a disk cut by an X, with a hole at the centre. traktor: ({ mask }) => ( <> ), // A cube split into three faces by a Y of spokes that meet in a ring. rekordbox: ({ mask }) => ( <> ), // A "C": a solid arc breaking into blades that thin toward three o'clock. // Fewer, wider blades than the original, so they stay distinct at 16 px. onelibrary: () => , } /** Export targets that are another FORMAT of a platform, drawn with its mark: * "Rekordbox Export" (a stick's Device Library) is still Rekordbox. */ const ALIASES: Record = { rekordbox_export: 'rekordbox', } export function PlatformIcon({ platform, size = 20, className, }: { platform: string size?: number className?: string }) { // Masks are addressed by id, and one page can show the same mark twice. const mask = `pm-${useId().replace(/:/g, '')}` const Mark = MARKS[platform] ?? MARKS[ALIASES[platform]] // A remote is a way to reach a library, not a platform with a mark of its own. if (platform === 'remote') return if (!Mark) return return ( ) }