feat: implement Settings page with tabs

This commit is contained in:
Maximilian Liebmann 2025-05-11 13:31:12 +02:00 committed by SomeCodecat
parent da5a2324c6
commit fd6462e02d

View file

@ -1,10 +1,79 @@
import { RedirectButton } from '@/components/user/redirect-button';
//import { RedirectButton } from '@/components/user/redirect-button';
import { Button } from '@/components/ui/button';
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
export default function Home() {
/*export default function Settings() {
return (
<div>
<h1>Settings</h1>
<RedirectButton redirectUrl='/home' buttonText='Home' />
</div>
);
}*/
export default function Settings() {
return (
<div className='flex flex-col items-center justify-center space-y-4 h-screen'>
<Tabs defaultValue='general' className='w-[400px]'>
<TabsList className='grid w-full grid-cols-2'>
<TabsTrigger value='general'>General</TabsTrigger>
<TabsTrigger value='account'>Account</TabsTrigger>
</TabsList>
<TabsContent value='general'>
<Card>
<CardHeader>
<CardTitle>General</CardTitle>
<CardDescription>
Make changes to your account here. Click save when you are done.
</CardDescription>
</CardHeader>
<CardContent className='space-y-2'>
<div className='space-y-1'>
<Label htmlFor='name'>Name</Label>
<Input id='name' defaultValue='Pedro Duarte' />
</div>
<div className='space-y-1'>
<Label htmlFor='username'>Username</Label>
<Input id='username' defaultValue='@peduarte' />
</div>
</CardContent>
<CardFooter>
<Button>Save changes</Button>
</CardFooter>
</Card>
</TabsContent>
<TabsContent value='account'>
<Card>
<CardHeader>
<CardTitle>Account Settings</CardTitle>
<CardDescription></CardDescription>
</CardHeader>
<CardContent className='space-y-2'>
<div className='space-y-1'>
<Label htmlFor='current'>Current password</Label>
<Input id='current' type='password' />
</div>
<div className='space-y-1'>
<Label htmlFor='new'>New password</Label>
<Input id='new' type='password' />
</div>
</CardContent>
<CardFooter>
<Button>Save password</Button>
</CardFooter>
</Card>
</TabsContent>
</Tabs>
</div>
);
}