| import type { MusicSource, MyPlatformAuth, PlatformAuthStatus } from '@music-together/shared' |
|
|
| |
| export const PLATFORM_LABELS: Record<MusicSource, string> = { |
| netease: '网易云音乐', |
| tencent: 'QQ 音乐', |
| kugou: '酷狗音乐', |
| kugou_concept: '酷狗概念版', |
| bilibili: 'B站', |
| } |
|
|
| |
| export const PLATFORM_SHORT_LABELS: Record<MusicSource, string> = { |
| netease: '网易云', |
| tencent: 'QQ 音乐', |
| kugou: '酷狗', |
| kugou_concept: '概念版', |
| bilibili: 'B站', |
| } |
|
|
| |
| export const PLATFORM_COLORS: Record<MusicSource, string> = { |
| netease: 'data-[state=active]:text-red-500', |
| tencent: 'data-[state=active]:text-green-500', |
| kugou: 'data-[state=active]:text-blue-500', |
| kugou_concept: 'data-[state=active]:text-sky-500', |
| bilibili: 'data-[state=active]:text-pink-500', |
| } |
|
|
| |
| export const PLATFORM_ACTIVE: Record<MusicSource, string> = { |
| netease: 'bg-red-500/15', |
| tencent: 'bg-green-500/15', |
| kugou: 'bg-blue-500/15', |
| kugou_concept: 'bg-sky-500/15', |
| bilibili: 'bg-pink-500/15', |
| } |
|
|
| |
| export const PLATFORM_TEXT: Record<MusicSource, string> = { |
| netease: 'text-red-500', |
| tencent: 'text-green-500', |
| kugou: 'text-blue-500', |
| kugou_concept: 'text-sky-500', |
| bilibili: 'text-pink-500', |
| } |
|
|
| |
| export const VIP_LABELS: Record<number, string> = { |
| 0: '', |
| 1: 'VIP', |
| 2: 'SVIP', |
| } |
|
|
| export function getVipDisplayLabel(vipType = 0, providerLabel?: string): string { |
| return providerLabel?.trim() || VIP_LABELS[vipType] || (vipType > 0 ? 'VIP' : '') |
| } |
|
|
| |
| export function getPlatformStatus( |
| platform: MusicSource, |
| statusList: PlatformAuthStatus[], |
| ): PlatformAuthStatus | undefined { |
| return statusList.find((s) => s.platform === platform) |
| } |
|
|
| |
| export function getMyPlatformStatus(platform: MusicSource, myStatusList: MyPlatformAuth[]): MyPlatformAuth | undefined { |
| return myStatusList.find((s) => s.platform === platform) |
| } |
|
|