diff --git a/src/components/SocialCard.tsx b/src/components/SocialCard.tsx deleted file mode 100644 index bd2ecf3..0000000 --- a/src/components/SocialCard.tsx +++ /dev/null @@ -1,103 +0,0 @@ -import Image from "next/image"; -import Link from "next/link"; -import React, {useEffect, useState} from 'react'; -import { api } from "@/utils/api"; - -// types -import type { - MedalApiObject, - SteamApiObject, - MusicApiObject -} from '@/utils/types' - -type SocialCardProps = { - platform: "steam" | "music" | "medal" -} - -function MedalSocialCard() { - const { data: medalData, medalFetchStatus } = api.social.getMedalData.useQuery(); - - return ( - <> - { - medalData?.data.map((v: MedalApiObject,k: number) => { - return
- {`${v.name} -
- -

{v.name}

- -

{v.artist["#text"]}

-
-
- }) - } - - ) -} - -function SteamSocialCard() { - const { data: SteamData, steamFetchStatus } = api.social.getSteamData.useQuery(); -} - -function MusicSocialCard() { - const { data: MusicData, musicFetchStatus } = api.social.getMusicData.useQuery(); - return -} - -export default function SocialCard({ platform }: SocialCardProps) { - const [content, setContent] = useState(null) - - - const platformDisplayElements = () => { - if (platform === "music") { - return ( -
- { - socialData?.data.map((v,k) => { - return
- {`${v.name} -
- -

{v.name}

- -

{v.artist["#text"]}

-
-
- }) - } -
- ) - } - } - - // return ( - //
- //

{displayPlatform}

- //
- // //
- // //

Listening To

- - // // {/* link to lastfm */} - // // - // // Powered by Last.fm - // // - // //
- // ) -} \ No newline at end of file diff --git a/src/server/api/root.ts b/src/server/api/root.ts index 017bcae..a229a41 100644 --- a/src/server/api/root.ts +++ b/src/server/api/root.ts @@ -1,6 +1,5 @@ import { postRouter } from "@/server/api/routers/post"; import { linksRouter } from "./routers/links"; -import { socialRouter } from "./routers/social"; import { blogRouter } from "./routers/blog"; import { createTRPCRouter } from "@/server/api/trpc"; @@ -12,7 +11,6 @@ import { createTRPCRouter } from "@/server/api/trpc"; export const appRouter = createTRPCRouter({ post: postRouter, links: linksRouter, - social: socialRouter, blog: blogRouter }); diff --git a/src/server/api/routers/social.ts b/src/server/api/routers/social.ts deleted file mode 100644 index 874937a..0000000 --- a/src/server/api/routers/social.ts +++ /dev/null @@ -1,31 +0,0 @@ -import {z} from 'zod'; -import axios from 'axios'; - -import { - createTRPCRouter, - publicProcedure -} from '@/server/api/trpc'; -import type { - MedalApiObject, - MusicApiObject, - SteamApiObject -} from '@/utils/types' - -const base_url = "https://api.thatalex.dev/v4/social/" -export const socialRouter = createTRPCRouter({ - getMedalData: publicProcedure - .query(async ({input}) => { - const response = await axios.get(base_url + "medal") - return response.data as MedalApiObject - }), - getSteamData: publicProcedure - .query(async ({input}) => { - const response = await axios.get(base_url + "steam") - return response.data as SteamApiObject - }), - getMusicData: publicProcedure - .query(async ({input}) => { - const response = await axios.get(base_url + "music") - return response.data as MusicApiObject - }) -}) \ No newline at end of file