'use client'; import { Avatar } from '@nextui-org/react'; import LogoutButton from 'components/button/logout'; import { Customer } from 'lib/woocomerce/models/customer'; import { Shipping } from 'lib/woocomerce/models/shipping'; import Link from 'next/link'; import { useEffect, useState } from 'react'; export default function ProfileLayout({ children }: { children: React.ReactNode }) { const [customer, setCustomer] = useState(undefined); const [shippingAddress, setShippingAddress] = useState(undefined); useEffect(() => { const fetchCustomer = async () => { const data = (await ( await fetch('/api/customer', { method: 'GET', headers: { 'Content-Type': 'application/json' } }) ).json()) as Customer; setCustomer(data); }; fetchCustomer(); }, []); return (

Profile

{customer && (
{customer.first_name} {customer.last_name}
)}
{children}
); }