import { DashboardShell } from '../../../components/dashboard-shell';
import { ProfileForms } from '../../../components/profile-forms';
import { requireAuthToken } from '../../../lib/auth';
import { fetchCurrentSession } from '../../../lib/api';

export default async function ProfilePage() {
  const token = await requireAuthToken();
  const session = await fetchCurrentSession(token);

  return (
    <DashboardShell currentPath="/dashboard/profile" title="My Profile">
      <section className="page-header profile-page-header">
        <div>
          <span className="page-eyebrow">Account Settings</span>
          <h1 className="page-heading">Manage your profile</h1>
          <p className="page-copy">Update your account details and password for the currently signed-in BizOne user.</p>
        </div>
      </section>
      <ProfileForms user={session.user} />
    </DashboardShell>
  );
}
