Skip to content

Commit

Permalink
Issues Resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
murtaza-sadri-19 committed Oct 9, 2024
1 parent 5b3bc59 commit a0cd3e1
Showing 1 changed file with 4 additions and 27 deletions.
31 changes: 4 additions & 27 deletions src/app/page.jsx
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;
}

0 comments on commit a0cd3e1

Please sign in to comment.