import type {FunctionComponent} from 'react'
import PageTitle from '@/components/custom/pageTitle'
import AccountForm from '@/app/(authenticated)/account/accountForm'
import {getSessionProfileFromCookie} from '@/lib/sessionUtils'

const PagePage: FunctionComponent = async () => {
  const profile = (await getSessionProfileFromCookie())!

  return (
    <>
      <div>
        <PageTitle>Welcome {profile?.username}</PageTitle>
        <AccountForm {...profile} />
      </div>
    </>
  )
}

export default PagePage
