diff --git a/src/components/commonHead.astro b/src/components/commonHead.astro index 3114b09..72ca5a2 100644 --- a/src/components/commonHead.astro +++ b/src/components/commonHead.astro @@ -5,30 +5,26 @@ const { title } = Astro.props; --- - - - - - {title} - - - + + + + + {title} + + + + diff --git a/src/components/header.astro b/src/components/header.astro index 9de8bc2..96cb72f 100644 --- a/src/components/header.astro +++ b/src/components/header.astro @@ -3,26 +3,36 @@ import { Moon, Sun } from "@lucide/astro"; ---
- - + +
diff --git a/src/components/hooks/yooper.ts b/src/components/hooks/yooper.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/components/lastfm.tsx b/src/components/lastfm.tsx index c5391d8..c724712 100644 --- a/src/components/lastfm.tsx +++ b/src/components/lastfm.tsx @@ -1,24 +1,8 @@ +import { useLastFm } from '@/hooks/use-lastfm.ts'; import clsx from 'clsx'; -import { useEffect, useState } from "react"; -import type { TrackResponse } from '../types/lastfm.ts'; export default function LastFM() { - const [track, setTrack] = useState(); - const [loading, setLoading] = useState(true); - const [error, setError] = useState(null); - - useEffect(() => { - fetch('/api/lastfm/recentTracks') - .then(res => res.json()) - .then(data => { - setTrack(data); - setLoading(false); - }) - .catch(err => { - setError(err.message); - setLoading(false); - }) - }, []) + const { track, loading, error } = useLastFm(); if (loading) return (
diff --git a/src/components/nav.astro b/src/components/nav.astro index 5b657fe..9b836bc 100644 --- a/src/components/nav.astro +++ b/src/components/nav.astro @@ -18,7 +18,12 @@ const { className } = Astro.props;