www/pages/playlists.tsx

34 lines
1.2 KiB
TypeScript
Raw Normal View History

2021-12-08 03:38:31 +00:00
import Layout from '../components/layout';
2022-04-28 01:55:18 +00:00
import { mapChild, toListItem } from '../components/lists';
2022-04-23 23:03:43 +00:00
import pl from '../public/playlists.yaml';
2021-12-08 03:38:31 +00:00
function Playlists() {
2021-12-08 03:38:31 +00:00
return (
<Layout name='Playlists'>
2022-04-28 01:55:18 +00:00
<h2>Music</h2>
{
pl.map((item: Record<string, any>) => {
const lItem = toListItem(item)
if (lItem)
return mapChild(lItem, 0, {
'spotify': (i) => {
return <div>
<a className='extern link button'
href={`https://open.spotify.com/track/${i.id}`}></a>
{i.title}</div>;
},
'youtube-playlist': (i) => {
return <div>
<a className='extern link button'
href={`https://youtube.com/playlist?list=${i.id}`}></a>
{i.title}</div>;
}
})
2022-04-28 01:55:18 +00:00
})
}
2021-12-08 03:38:31 +00:00
</Layout>
);
}
2022-01-25 00:58:01 +00:00
export default Playlists;