import { withPageAuthRequired } from "@auth0/nextjs-auth0/client"; import Grid from '@mui/material/Grid'; import Card from '@mui/material/Card'; import CardActions from '@mui/material/CardActions'; import CardContent from '@mui/material/CardContent'; import CardMedia from '@mui/material/CardMedia'; import Button from '@mui/material/Button'; import Typography from '@mui/material/Typography'; import { useEffect, useState } from "react"; import EditableArtistPortfolio from "../../../components/dashboard/artist/editablePortfolio"; import ArtistPortfolio from "../../../components/dashboard/artist/portfolio"; import { DataGrid, GridColDef, GridValueGetterParams } from '@mui/x-data-grid'; import Rating from '@mui/material/Rating'; import CircularProgress from '@mui/material/CircularProgress'; import Box from '@mui/material/Box'; import Reviews from "../../../components/dashboard/artist/reviews"; const Profile = () => { const [profileData, setArtistData] = useState(null); const [description, setDescription] = useState(""); const [guidelines, setGuidelines] = useState(""); const [loading, setLoading] = useState(true); const getData = async () => { const profileResponse = await fetch('/api/artist/profile'); const sellerProfile = await profileResponse.json(); setArtistData(sellerProfile); setDescription(sellerProfile["description"]); setGuidelines(sellerProfile["requestGuidelines"]); setLoading(false); } useEffect(() => { getData() }, []); const columns: GridColDef[] = [ { field: 'message', headerName: 'Review', flex: 0.75 }, { field: 'rating', headerName: 'Rating', flex: 0.25, renderCell: (params: GridValueGetterParams) => ( ), }, ]; const rows = [ { id: 1, message: 'Great work!', rating: 5 }, { id: 2, message: 'BAD work!', rating: 1 }, { id: 3, message: 'Okay work!', rating: 4 }, { id: 4, message: 'Meh work!', rating: 2 }, { id: 5, message: 'Great work!', rating: 5 }, { id: 6, message: 'Mid work!', rating: 3 }, { id: 7, message: 'HORRIBLE work!', rating: 1 }, ]; return ( (loading) ? ( ):( STORE HEADER BIOGRAPHY HEADER {description} GUIDELINES HEADER {guidelines} By clicking "Start New Request" you are agreeing to the terms above and to the terms of service. [TERMS OF SERVICE] REVIEWS HEADER {profileData!=null ? ( ):null} PORTFOLIO HEADER {profileData!=null ? ( ):null} ) ); }; // Protected route, checking user authentication client-side.(CSR) export default withPageAuthRequired(Profile);