This commit is contained in:
skidoodle
2023-04-09 05:31:08 +02:00
commit 9cf213d556
29 changed files with 3825 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import { AppProps } from 'next/app';
import { Analytics } from '@vercel/analytics/react';
import { ThemeProvider } from 'next-themes';
import Head from 'next/head';
import '@/styles/globals.scss';
export default function App({ Component, pageProps }: AppProps) {
return (
<>
<Head>
<title>albert</title>
</Head>
<ThemeProvider>
<Component {...pageProps} />
</ThemeProvider>
<Analytics />
</>
);
}
+21
View File
@@ -0,0 +1,21 @@
import { Html, Head, Main, NextScript } from 'next/document';
export default function Document() {
return (
<Html lang='en'>
<Head>
<link rel='preconnect' href='https://vitals.vercel-insights.com' />
<meta name='title' content='albert' />
<meta name='og:title' content='albert' />
<meta name='description' content='system administrator' />
<meta name='og:description' content='system administrator' />
<meta name='theme-color' content='#000000' />
<meta property='og:image' content='/favicon.ico' />
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
+26
View File
@@ -0,0 +1,26 @@
import type { NextApiRequest, NextApiResponse } from 'next';
import { SpotifyService } from '@/service/spotify';
const { CLIENT_ID, CLIENT_SECRET, REFRESH_TOKEN } = process.env;
const spotify = new SpotifyService(CLIENT_ID!, CLIENT_SECRET!, REFRESH_TOKEN!);
export default async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
const song = await spotify.getCurrentSong();
if (!song || !song.isPlaying) {
return res.status(200).json({
nowplaying: false,
});
}
res.status(200).json({
nowplaying: true,
song: {
artist: song.artists.name,
title: song.title,
url: song.url,
image: song.album.image,
},
});
}
+9
View File
@@ -0,0 +1,9 @@
import { MainLayout } from '@/components/MainLayout';
export default function Home() {
return (
<>
<MainLayout />
</>
);
}