Skip to content

Commit

Permalink
Wrapped Index Page
Browse files Browse the repository at this point in the history
  • Loading branch information
Ifechukwudaniel committed Dec 15, 2023
1 parent c276ad8 commit 1a7e7c0
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions packages/nextjs/pages/wrapped/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { GetServerSideProps } from "next";
import { getSession } from "next-auth/react";
import DashboardLayout from "~~/components/dashboard/DashboardLayout";
import Heading from "~~/components/spotify/Heading";
import Layout from "~~/components/spotify/Layout";
import { MySession } from "~~/types/session";
import { PlaylistType } from "~~/types/spotify";
import { isAuthenticated } from "~~/utils/beat-bridge/isAuthenticated";

interface IProps {
userPlaylist: PlaylistType[];
}

export default function FollowedArtists({ userPlaylist }: IProps) {
console.log(userPlaylist);
return (
<DashboardLayout>
<Layout title="Beat Bridge - Your Wrapped">
<Heading text="Your Wrapped" />
</Layout>
</DashboardLayout>
);
}

export const getServerSideProps: GetServerSideProps = async ctx => {
const session = (await getSession(ctx)) as MySession | null;

if (!(await isAuthenticated(session))) {
return {
redirect: {
destination: "/login",
permanent: false,
},
};
}

return { props: { userPlaylist: [] } };
};

0 comments on commit 1a7e7c0

Please sign in to comment.