CoastalCommitsPastes/client/app/settings/page.tsx

35 lines
869 B
TypeScript
Raw Normal View History

2022-11-12 04:28:06 -05:00
import Header from "@components/header"
import SettingsGroup from "../components/settings-group"
2022-11-12 03:58:21 -05:00
import Password from "app/settings/components/sections/password"
import Profile from "app/settings/components/sections/profile"
import { authOptions } from "@lib/server/auth"
import { getCurrentUser } from "@lib/server/session"
import { redirect } from "next/navigation"
2022-11-10 02:11:36 -05:00
export default async function SettingsPage() {
const user = await getCurrentUser()
2022-11-10 02:11:36 -05:00
if (!user) {
return redirect(authOptions.pages?.signIn || "/new")
}
return (
2022-11-12 21:39:03 -05:00
<div
style={{
display: "flex",
flexDirection: "column",
gap: "var(--gap)",
marginBottom: "var(--gap)"
}}
>
<h1>Settings</h1>
<SettingsGroup title="Profile">
<Profile user={user} />
</SettingsGroup>
{/* <SettingsGroup title="Password">
2022-11-12 21:39:03 -05:00
<Password />
</SettingsGroup> */}
2022-11-12 21:39:03 -05:00
</div>
)
}