// import { lanyard } from "utils/shared/lanyard"; import { useLanyard } from "use-lanyard"; import styles from "styles/Lanyard.module.sass"; import Image from "next/image"; import { useTheme } from 'next-themes' import useWindowSize from "utils/shared/hooks/useWindowSize"; import Icon from "./Icon"; const Lanyard = () => { const id = process.env.NEXT_DISCORD_ID || "318044130796109825"; const lanyard = useLanyard(id).data; const { resolvedTheme: theme } = useTheme() const windowSize = useWindowSize() if (!lanyard?.listening_to_spotify) return; let artists; if (lanyard.spotify.artist.split(";").length > 2) { artists = [ lanyard.spotify.artist.split(";")[0], lanyard.spotify.artist.split(";")[1], ].join(","); } else { artists = lanyard.spotify.artist.split(";").join(" &"); } return ( <> {(windowSize.width <= 550 || windowSize.height <= 800) ? (<>

{lanyard.spotify.song} by {artists}

) : (<>

{lanyard.spotify.song}

{artists}

)} ); }; export default Lanyard;