import { useUser,withPageAuthRequired } from "@auth0/nextjs-auth0/client"; import { Grid, Typography } from "@mui/material"; import Card from "@mui/material/Card"; import CardContent from "@mui/material/CardContent"; import EditableArtistPortfolio from "../../../components/Old/editableArtistPortfolio"; import { useEffect, useState } from "react"; import TextField from '@mui/material/TextField'; import Button from '@mui/material/Button'; import Switch from '@mui/material/Switch'; import Divider from '@mui/material/Divider'; const ArtistSettings = () => { const {user, isLoading} = useUser(); const [profileData, setSellerProfileData] = useState(null); const getData = async () => { const profileResponse = await fetch('/api/artist/profile'); const sellerProfile = await profileResponse.json(); setSellerProfileData(sellerProfile); } useEffect(() => { getData() }, []); return ( General Settings {(profileData != null) ? ( ):null} ); }; // Protected route, checking user authentication client-side.(CSR) export default withPageAuthRequired(ArtistSettings);