import { open } from 'helpers/windowActions' import appList from 'configs/appList' import useApps from 'hooks/useApps' import fetchJson from 'helpers/fetchJson' import styles from '../styles/Radio.module.scss' const play = async (title, station, apps, setApps, enqueue) => { const streamData = await fetchJson('/api/radio/stream', { method: 'POST', body: JSON.stringify({ station }) }) const items = [{ type: 'radio', title, ...streamData }] apps && apps.length > 0 && apps.some(a => a && a.name === 'Player') ? setApps(prev => prev.map(a => a.name === 'Player' ? { ...a, props: { list: { items, enqueue } } } : a)) : open({ appName: 'Player', ...appList.Player }, setApps, { list: { items, enqueue } }) } const List = ({ results, enqueue }) => { const { apps, setApps } = useApps() return (