mirror of
https://codeberg.org/MarkusThielker/finances.git
synced 2025-07-04 03:59:18 +00:00
Initial commit
This commit is contained in:
commit
52aed24a96
48 changed files with 6980 additions and 0 deletions
54
src/app/account/page.tsx
Normal file
54
src/app/account/page.tsx
Normal file
|
@ -0,0 +1,54 @@
|
|||
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import React from 'react';
|
||||
import { getUser } from '@/auth';
|
||||
import { redirect } from 'next/navigation';
|
||||
import signOut from '@/lib/actions/signOut';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import Link from 'next/link';
|
||||
import { ChevronLeft } from 'lucide-react';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import SignOutForm from '@/components/form/signOutForm';
|
||||
import { URL_HOME, URL_SIGN_IN } from '@/lib/constants';
|
||||
|
||||
export default async function AccountPage() {
|
||||
|
||||
const user = await getUser();
|
||||
|
||||
if (!user) {
|
||||
redirect(URL_SIGN_IN);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen flex-col items-center justify-center relative">
|
||||
<Button variant="ghost" size="icon" className="absolute top-4 left-4" asChild>
|
||||
<Link href={URL_HOME}>
|
||||
<ChevronLeft/>
|
||||
</Link>
|
||||
</Button>
|
||||
<Card className="w-full max-w-md">
|
||||
<CardHeader>
|
||||
<CardTitle>Hey, {user?.username}!</CardTitle>
|
||||
<CardDescription>This is your account overview.</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-2">
|
||||
<div>
|
||||
<Label>ID</Label>
|
||||
<Input
|
||||
disabled
|
||||
value={user?.id}/>
|
||||
</div>
|
||||
<div>
|
||||
<Label>Username</Label>
|
||||
<Input
|
||||
disabled
|
||||
value={user?.username}/>
|
||||
</div>
|
||||
</CardContent>
|
||||
<CardFooter>
|
||||
<SignOutForm onSubmit={signOut}/>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue