export async function getServerSideProps({ query }: NextPageContext) {
const response = await fetch(`http://localhost:5000/api/users/${query.name}`, {
method: "GET",
headers: {
Authorization: `Bearer ${Cookies.get("token")}`
}
});
const user = await response.json();
return { props: { user } };
}