import React, { useState, useEffect } from "react"; import Navbar from "../components/Layout/Navbar"; import { useParams } from "react-router-dom"; interface UserProfileData { username: string; bio: string; followerCount: number; isPartnered: boolean; } const UserPage: React.FC = () => { const [profileData, setProfileData] = useState(null); const { username } = useParams(); useEffect(() => { // Fetch user profile data fetch(`/api/get_streamer_data/${username}`) .then((res) => res.json()) .then((data) => { setProfileData({ username: data.username, bio: data.bio || "This user hasn't written a bio yet.", followerCount: data.num_followering || 0, isPartnered: data.isPartnered || false, }); }) .catch((err) => console.error("Error fetching profile data:", err)); }, [username]); if (!profileData) { return (
Loading...
); } return (
{/* Profile Section - Left Third */}
{/* Profile Picture */}
{`${profileData.username}'s {profileData.isPartnered && (
)}

{profileData.username}

{profileData.followerCount.toLocaleString()} followers {profileData.isPartnered && ( Partner )}
{/* Bio Section */}

About {profileData.username}

{profileData.bio}

{/* Additional Stats */}
0
Total Views
0
Following
{/* Content Section */}

Past Broadcasts

No past broadcasts found
); }; export default UserPage;