CoreControl/app/dashboard/settings/SettingsPage.tsx

69 lines
2.2 KiB
TypeScript
Raw Normal View History

2025-05-17 21:39:10 +02:00
'use client';
2025-05-17 20:17:39 +02:00
2025-05-17 21:39:10 +02:00
import Sidebar from '@/components/Sidebar';
import ErrorToast from '@/components/Error';
2025-05-20 23:45:21 +02:00
import { ProfileSettings } from '@/components/cards/settings/ProfileSettings';
import { PasswordSettings } from '@/components/cards/settings/PasswordSettings';
2025-05-17 21:39:10 +02:00
import { useState } from 'react';
2025-05-17 20:17:39 +02:00
2025-05-17 21:25:09 +02:00
interface SettingsPageProps {
2025-05-17 21:39:10 +02:00
username: string;
name: string;
email: string;
2025-05-17 20:17:39 +02:00
}
2025-05-17 21:39:10 +02:00
export default function SettingsPage({ username, name, email }: SettingsPageProps) {
const [error, setError] = useState('');
2025-05-24 15:40:08 +02:00
2025-05-17 21:39:10 +02:00
return (
<div>
<Sidebar
username={username}
fullName={name}
breadcrumbPath={['/', 'Dashboard', 'Settings']}
>
<main>
<h1 className="text-2xl font-bold">Settings</h1>
<p className="text-sm opacity-70">Manage your instance settings</p>
<div className="tabs tabs-border pt-8">
<input
type="radio"
2025-05-24 19:51:17 +02:00
name="settings"
2025-05-17 21:39:10 +02:00
className="tab text-primary z-10"
aria-label="User Settings"
2025-05-24 15:40:08 +02:00
defaultChecked
2025-05-17 21:39:10 +02:00
/>
<div className="tab-content relative bg-base-100 pl-4 pt-4">
<div className="absolute -top-[3px] left-6 right-0 h-[2px] bg-stone-800"></div>
2025-05-24 15:40:08 +02:00
<div className="flex flex-col gap-4">
2025-05-17 21:39:10 +02:00
<ProfileSettings
initialUsername={username}
initialName={name}
initialEmail={email}
onError={setError}
/>
2025-05-24 15:40:08 +02:00
<PasswordSettings onError={setError} />
</div>
</div>
<input
type="radio"
2025-05-24 19:51:17 +02:00
name="settings"
2025-05-24 15:40:08 +02:00
className="tab text-primary z-10"
aria-label="Notification Settings"
/>
<div className="tab-content relative bg-base-100 pl-4 pt-4">
<div className="absolute -top-[3px] left-6 right-0 h-[2px] bg-stone-800"></div>
<div className="flex flex-col gap-4">
test
2025-05-17 21:39:10 +02:00
</div>
</div>
</div>
</main>
</Sidebar>
<ErrorToast message={error} show={error !== ''} onClose={() => setError('')} />
</div>
);
2025-05-17 20:17:39 +02:00
}