import { useEffect, useState } from 'react';
import UserPage from '@/components/Global/User';
import { NextSeo } from "next-seo";
export default function UserProfilePage({ url }) {
const [userData, setUserData] = useState(null);
const apiUrl = process.env.NEXT_PUBLIC_API_URL;
useEffect(() => {
const fetchData = async () => {
try {
const response = await fetch(`${apiUrl}/v1/entity/${url}`);
if (response.ok) {
const data = await response.json();
setUserData(data.data);
} else {
console.error('Failed to fetch user data');
}
} catch (error) {
console.error('Error fetching user data:', error);
}
};
fetchData();
}, [apiUrl, url]);
return (
<>