-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b3bc59
commit a0cd3e1
Showing
1 changed file
with
4 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,7 @@ | ||
import { useState, useEffect } from "react"; | ||
import { useRouter } from "next/navigation"; | ||
import { generateUserTagline } from "../api/ai/route"; | ||
|
||
function UserPage({ params }) { | ||
const { username } = params; | ||
const router = useRouter(); | ||
const [tagline, setTagline] = useState(""); | ||
|
||
useEffect(() => { | ||
const fetchTagline = async () => { | ||
const response = await fetch(`/api/ai?username=${username}`); | ||
const data = await response.json(); | ||
if (data.exists) { | ||
setTagline(data.tagline); | ||
} else { | ||
setTagline("No tagline available"); | ||
} | ||
}; | ||
fetchTagline(); | ||
}, [username]); | ||
import Home from "../../components/Home"; | ||
|
||
export default function Page() { | ||
return ( | ||
<div> | ||
<h1>{tagline}</h1> | ||
</div> | ||
<Home /> | ||
); | ||
} | ||
|
||
export default UserPage; | ||
} |