mirror of
https://github.com/SrIzan10/lofi.git
synced 2026-06-06 00:56:53 +00:00
20 lines
594 B
TypeScript
20 lines
594 B
TypeScript
import { type ClassValue, clsx } from 'clsx';
|
|
import { twMerge } from 'tailwind-merge';
|
|
import type { ChillhopData, Song } from './types';
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
return twMerge(clsx(inputs));
|
|
}
|
|
|
|
export async function getGeneralData() {
|
|
const res = await fetch('https://stream.chillhop.com/presets');
|
|
const data = (await res.json()) as ChillhopData;
|
|
return data;
|
|
}
|
|
|
|
export async function getStationSongs(stationId: number) {
|
|
const res = await fetch(`https://stream.chillhop.com/live/${stationId}`);
|
|
const data = (await res.json()) as Song[];
|
|
return data;
|
|
}
|