feat: add link to home page from dashboard
This commit is contained in:
@@ -1,7 +1,10 @@
|
|||||||
import Image from "next/image"
|
import Image from "next/image"
|
||||||
import { notFound } from "next/navigation"
|
import { notFound } from "next/navigation"
|
||||||
import { cookies } from "next/headers"
|
import { cookies } from "next/headers"
|
||||||
|
import Link from "next/link"
|
||||||
|
import { ChevronLeft } from "lucide-react"
|
||||||
import prisma from "@/lib/prisma"
|
import prisma from "@/lib/prisma"
|
||||||
|
import { Button } from "@/components/ui/button"
|
||||||
import { PlanLoginForm } from "@/components/plan-login-form"
|
import { PlanLoginForm } from "@/components/plan-login-form"
|
||||||
import { PlanDashboard } from "./_components/plan-dashboard"
|
import { PlanDashboard } from "./_components/plan-dashboard"
|
||||||
import { getDictionary } from "@/get-dictionary"
|
import { getDictionary } from "@/get-dictionary"
|
||||||
@@ -37,31 +40,40 @@ export default async function DashboardPage({
|
|||||||
return (
|
return (
|
||||||
<main className="flex min-h-screen flex-col items-center p-4">
|
<main className="flex min-h-screen flex-col items-center p-4">
|
||||||
<div className="w-full max-w-4xl space-y-6">
|
<div className="w-full max-w-4xl space-y-6">
|
||||||
<div className="flex flex-col md:flex-row justify-between items-start md:items-center gap-4">
|
<div className="flex flex-col gap-4">
|
||||||
<div className="flex items-center gap-4">
|
<Button variant="ghost" size="sm" asChild className="w-fit -ml-2 text-muted-foreground">
|
||||||
<div className="bg-white p-1.5 rounded-xl shadow-sm border border-primary/10">
|
<Link href={`/${lang}`}>
|
||||||
<Image
|
<ChevronLeft className="w-4 h-4 mr-1" />
|
||||||
src="/icon.png"
|
{dict.dashboard.backToHome}
|
||||||
alt="Logo"
|
</Link>
|
||||||
width={48}
|
</Button>
|
||||||
height={48}
|
|
||||||
className="rounded-lg"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h1 className="text-2xl font-bold">{dict.home.title}</h1>
|
|
||||||
<p className="text-muted-foreground text-sm">
|
|
||||||
{plan.startDate.toLocaleDateString(lang)} - {plan.endDate.toLocaleDateString(lang)}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="text-sm bg-muted px-3 py-1 rounded-md">
|
|
||||||
Plan ID: <span className="font-mono font-bold">{plan.id}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="p-4 border rounded-lg bg-card text-card-foreground shadow-sm">
|
<div className="flex flex-col md:flex-row justify-between items-start md:items-center gap-4">
|
||||||
<PlanDashboard plan={plan} dict={dict.dashboard} settingsDict={dict.settings} lang={lang} />
|
<div className="flex items-center gap-4">
|
||||||
|
<div className="bg-white p-1.5 rounded-xl shadow-sm border border-primary/10">
|
||||||
|
<Image
|
||||||
|
src="/icon.png"
|
||||||
|
alt="Logo"
|
||||||
|
width={48}
|
||||||
|
height={48}
|
||||||
|
className="rounded-lg"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h1 className="text-2xl font-bold">{dict.home.title}</h1>
|
||||||
|
<p className="text-muted-foreground text-sm">
|
||||||
|
{plan.startDate.toLocaleDateString(lang)} - {plan.endDate.toLocaleDateString(lang)}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="text-sm bg-muted px-3 py-1 rounded-md">
|
||||||
|
Plan ID: <span className="font-mono font-bold">{plan.id}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="p-4 border rounded-lg bg-card text-card-foreground shadow-sm">
|
||||||
|
<PlanDashboard plan={plan} dict={dict.dashboard} settingsDict={dict.settings} lang={lang} />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
"passwordError": "Das Passwort muss mindestens 4 Zeichen lang sein."
|
"passwordError": "Das Passwort muss mindestens 4 Zeichen lang sein."
|
||||||
},
|
},
|
||||||
"dashboard": {
|
"dashboard": {
|
||||||
|
"backToHome": "Zur Startseite",
|
||||||
"overview": "Übersicht",
|
"overview": "Übersicht",
|
||||||
"instructions": "Anleitungen",
|
"instructions": "Anleitungen",
|
||||||
"instructionsTitle": "Katzenpflege-Anleitungen",
|
"instructionsTitle": "Katzenpflege-Anleitungen",
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
"passwordError": "Password must be at least 4 characters."
|
"passwordError": "Password must be at least 4 characters."
|
||||||
},
|
},
|
||||||
"dashboard": {
|
"dashboard": {
|
||||||
|
"backToHome": "Back to Home",
|
||||||
"overview": "Overview",
|
"overview": "Overview",
|
||||||
"instructions": "Instructions",
|
"instructions": "Instructions",
|
||||||
"instructionsTitle": "Cat Care Instructions",
|
"instructionsTitle": "Cat Care Instructions",
|
||||||
|
|||||||
Reference in New Issue
Block a user