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"
|
2022-11-11 22:17:44 -05:00
|
|
|
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
|
|
|
|
2022-11-11 22:17:44 -05:00
|
|
|
export default async function SettingsPage() {
|
|
|
|
const user = await getCurrentUser()
|
2022-11-10 02:11:36 -05:00
|
|
|
|
2022-11-11 22:17:44 -05:00
|
|
|
if (!user) {
|
2022-11-12 19:06:23 -05:00
|
|
|
return redirect(authOptions.pages?.signIn || "/new")
|
2022-11-11 22:17:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
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>
|
2022-11-14 02:28:51 -05:00
|
|
|
{/* <SettingsGroup title="Password">
|
2022-11-12 21:39:03 -05:00
|
|
|
<Password />
|
2022-11-14 02:28:51 -05:00
|
|
|
</SettingsGroup> */}
|
2022-11-12 21:39:03 -05:00
|
|
|
</div>
|
2022-11-11 22:17:44 -05:00
|
|
|
)
|
|
|
|
}
|