Site için geliştirmeler yapıldı.
This commit is contained in:
0
app/(dashboard)/.gitkeep
Normal file
0
app/(dashboard)/.gitkeep
Normal file
130
app/(dashboard)/dashboard/page.tsx
Normal file
130
app/(dashboard)/dashboard/page.tsx
Normal file
@@ -0,0 +1,130 @@
|
||||
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import { DollarSign, ShoppingCart, Users, CreditCard } from "lucide-react"
|
||||
|
||||
export default function DashboardPage() {
|
||||
return (
|
||||
<div className="flex-1 space-y-4">
|
||||
<div className="flex items-center justify-between space-y-2">
|
||||
<h2 className="text-3xl font-bold tracking-tight">Genel Bakış</h2>
|
||||
</div>
|
||||
|
||||
{/* Stats Grid */}
|
||||
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle className="text-sm font-medium">Toplam Gelir</CardTitle>
|
||||
<DollarSign className="h-4 w-4 text-muted-foreground" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-bold">₺45,231.89</div>
|
||||
<p className="text-xs text-muted-foreground">+20.1% geçen aya göre</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle className="text-sm font-medium">Abonelikler</CardTitle>
|
||||
<Users className="h-4 w-4 text-muted-foreground" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-bold">+2350</div>
|
||||
<p className="text-xs text-muted-foreground">+180.1% geçen aya göre</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle className="text-sm font-medium">Satışlar</CardTitle>
|
||||
<CreditCard className="h-4 w-4 text-muted-foreground" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-bold">+12,234</div>
|
||||
<p className="text-xs text-muted-foreground">+19% geçen aya göre</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle className="text-sm font-medium">Aktif Şimdi</CardTitle>
|
||||
<Users className="h-4 w-4 text-muted-foreground" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-bold">+573</div>
|
||||
<p className="text-xs text-muted-foreground">+201 son bir saatte</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-7">
|
||||
{/* Recent Sales / Activity */}
|
||||
<Card className="col-span-4">
|
||||
<CardHeader>
|
||||
<CardTitle>Son Hareketler</CardTitle>
|
||||
<CardDescription>
|
||||
Bu ay 265+ satış yaptınız.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{/* Mock List */}
|
||||
<div className="space-y-8">
|
||||
<div className="flex items-center">
|
||||
<div className="h-9 w-9 rounded-full bg-slate-100 flex items-center justify-center">
|
||||
<span className="font-bold text-xs">OM</span>
|
||||
</div>
|
||||
<div className="ml-4 space-y-1">
|
||||
<p className="text-sm font-medium leading-none">Ozan Mehmet</p>
|
||||
<p className="text-sm text-muted-foreground">ozan@email.com</p>
|
||||
</div>
|
||||
<div className="ml-auto font-medium">+₺1,999.00</div>
|
||||
</div>
|
||||
<div className="flex items-center">
|
||||
<div className="h-9 w-9 rounded-full bg-slate-100 flex items-center justify-center">
|
||||
<span className="font-bold text-xs">AÖ</span>
|
||||
</div>
|
||||
<div className="ml-4 space-y-1">
|
||||
<p className="text-sm font-medium leading-none">Ayşe Özdemir</p>
|
||||
<p className="text-sm text-muted-foreground">ayse@email.com</p>
|
||||
</div>
|
||||
<div className="ml-auto font-medium">+₺39.00</div>
|
||||
</div>
|
||||
<div className="flex items-center">
|
||||
<div className="h-9 w-9 rounded-full bg-slate-100 flex items-center justify-center">
|
||||
<span className="font-bold text-xs">MK</span>
|
||||
</div>
|
||||
<div className="ml-4 space-y-1">
|
||||
<p className="text-sm font-medium leading-none">Mehmet Kaya</p>
|
||||
<p className="text-sm text-muted-foreground">mehmet@email.com</p>
|
||||
</div>
|
||||
<div className="ml-auto font-medium">+₺299.00</div>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Recent Products or Other Info */}
|
||||
<Card className="col-span-3">
|
||||
<CardHeader>
|
||||
<CardTitle>Son Eklenen Ürünler</CardTitle>
|
||||
<CardDescription>
|
||||
Stoğa yeni giren ürünler.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="space-y-4">
|
||||
<div className="flex justify-between items-center bg-slate-50 p-2 rounded">
|
||||
<span className="text-sm font-medium">Çelik Kasa EV-100</span>
|
||||
<span className="text-xs bg-green-100 text-green-700 px-2 py-1 rounded">Stokta</span>
|
||||
</div>
|
||||
<div className="flex justify-between items-center bg-slate-50 p-2 rounded">
|
||||
<span className="text-sm font-medium">Ofis Tipi XYZ</span>
|
||||
<span className="text-xs bg-yellow-100 text-yellow-700 px-2 py-1 rounded">Azaldı</span>
|
||||
</div>
|
||||
<div className="flex justify-between items-center bg-slate-50 p-2 rounded">
|
||||
<span className="text-sm font-medium">Otel Kasası H-20</span>
|
||||
<span className="text-xs bg-green-100 text-green-700 px-2 py-1 rounded">Stokta</span>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
34
app/(dashboard)/layout.tsx
Normal file
34
app/(dashboard)/layout.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import { createClient } from "@/lib/supabase-server"
|
||||
import { redirect } from "next/navigation"
|
||||
import { Sidebar } from "@/components/dashboard/sidebar"
|
||||
import { DashboardHeader } from "@/components/dashboard/header"
|
||||
|
||||
export default async function DashboardLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
const supabase = createClient()
|
||||
const { data: { user } } = await supabase.auth.getUser()
|
||||
|
||||
if (!user) {
|
||||
redirect("/login")
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen w-full flex-col bg-muted/40">
|
||||
<aside className="fixed inset-y-0 left-0 z-10 hidden w-64 flex-col border-r bg-background sm:flex">
|
||||
<div className="flex h-14 items-center border-b px-4 lg:h-[60px] lg:px-6">
|
||||
<span className="font-semibold text-lg">ParaKasa Panel</span>
|
||||
</div>
|
||||
<Sidebar className="flex-1" />
|
||||
</aside>
|
||||
<div className="flex flex-col sm:gap-4 sm:py-4 sm:pl-64">
|
||||
<DashboardHeader />
|
||||
<main className="grid flex-1 items-start gap-4 p-4 sm:px-6 sm:py-0 md:gap-8">
|
||||
{children}
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user