diff --git a/app/(dashboard)/.gitkeep b/app/(dashboard)/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/(dashboard)/dashboard/page.tsx b/app/(dashboard)/dashboard/page.tsx new file mode 100644 index 0000000..83e7937 --- /dev/null +++ b/app/(dashboard)/dashboard/page.tsx @@ -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 ( +
+
+

Genel Bakış

+
+ + {/* Stats Grid */} +
+ + + Toplam Gelir + + + +
₺45,231.89
+

+20.1% geçen aya göre

+
+
+ + + Abonelikler + + + +
+2350
+

+180.1% geçen aya göre

+
+
+ + + Satışlar + + + +
+12,234
+

+19% geçen aya göre

+
+
+ + + Aktif Şimdi + + + +
+573
+

+201 son bir saatte

+
+
+
+ +
+ {/* Recent Sales / Activity */} + + + Son Hareketler + + Bu ay 265+ satış yaptınız. + + + + {/* Mock List */} +
+
+
+ OM +
+
+

Ozan Mehmet

+

ozan@email.com

+
+
+₺1,999.00
+
+
+
+ +
+
+

Ayşe Özdemir

+

ayse@email.com

+
+
+₺39.00
+
+
+
+ MK +
+
+

Mehmet Kaya

+

mehmet@email.com

+
+
+₺299.00
+
+
+
+
+ + {/* Recent Products or Other Info */} + + + Son Eklenen Ürünler + + Stoğa yeni giren ürünler. + + + +
+
+ Çelik Kasa EV-100 + Stokta +
+
+ Ofis Tipi XYZ + Azaldı +
+
+ Otel Kasası H-20 + Stokta +
+
+
+
+
+
+ ) +} diff --git a/app/(dashboard)/layout.tsx b/app/(dashboard)/layout.tsx new file mode 100644 index 0000000..080a16e --- /dev/null +++ b/app/(dashboard)/layout.tsx @@ -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 ( +
+ +
+ +
+ {children} +
+
+
+ ); +} diff --git a/app/(public)/.gitkeep b/app/(public)/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/(public)/contact/page.tsx b/app/(public)/contact/page.tsx new file mode 100644 index 0000000..62155f8 --- /dev/null +++ b/app/(public)/contact/page.tsx @@ -0,0 +1,183 @@ +"use client" + +import { useState } from "react" +import { useForm } from "react-hook-form" +import { zodResolver } from "@hookform/resolvers/zod" +import { Button } from "@/components/ui/button" +import { Input } from "@/components/ui/input" +import { Textarea } from "@/components/ui/textarea" +import { Card, CardContent } from "@/components/ui/card" +import { Mail, MapPin, Phone, Loader2, CheckCircle } from "lucide-react" +import { contactFormSchema, ContactFormValues } from "@/lib/schemas" +import { submitContactForm } from "@/lib/actions/contact" +import { toast } from "sonner" + +export default function ContactPage() { + const [isSubmitting, setIsSubmitting] = useState(false) + const [isSuccess, setIsSuccess] = useState(false) + + const form = useForm({ + resolver: zodResolver(contactFormSchema), + defaultValues: { + name: "", + surname: "", + email: "", + phone: "", + subject: "", + message: "", + }, + }) + + async function onSubmit(data: ContactFormValues) { + setIsSubmitting(true) + try { + const response = await submitContactForm(data) + if (response.success) { + setIsSuccess(true) + form.reset() + toast.success("Mesajınız başarıyla gönderildi.") + } else { + toast.error("Hata: " + response.error) + } + } catch (error) { + toast.error("Bir hata oluştu.") + } finally { + setIsSubmitting(false) + } + } + + return ( +
+
+

İletişime Geçin

+

+ Sorularınız, teklif talepleriniz veya teknik destek için bize ulaşın. +

+
+ +
+
+
+

İletişim Bilgileri

+
+ +
+

Merkez Ofis & Showroom

+

+ Organize Sanayi Bölgesi, 12. Cadde No: 45
+ Başakşehir, İstanbul +

+
+
+
+ +
+

Telefon

+

+90 (212) 555 00 00

+
+
+
+ +
+

E-posta

+

info@parakasa.com

+
+
+
+
+
+ Harita (Google Maps Embed) +
+
+
+ + + + {isSuccess ? ( +
+ +

Mesajınız Alındı!

+

+ En kısa sürede size dönüş yapacağız. +

+ +
+ ) : ( +
+
+
+ + + {form.formState.errors.name &&

{form.formState.errors.name.message}

} +
+
+ + + {form.formState.errors.surname &&

{form.formState.errors.surname.message}

} +
+
+
+
+ + + {form.formState.errors.email &&

{form.formState.errors.email.message}

} +
+
+ +
+
+ 🇹🇷 + +90 +
+
+ { + let value = e.target.value.replace(/\D/g, ''); // Remove non-digits + if (value.startsWith('90')) value = value.slice(2); // Remove leading 90 if user types it + + // Format: (5XX) XXX XX XX + let formattedValue = ''; + if (value.length > 0) formattedValue += '(' + value.substring(0, 3); + if (value.length > 3) formattedValue += ') ' + value.substring(3, 6); + if (value.length > 6) formattedValue += ' ' + value.substring(6, 8); + if (value.length > 8) formattedValue += ' ' + value.substring(8, 10); + + e.target.value = formattedValue; + return e; + } + })} + /> +
+ {form.formState.errors.phone &&

{form.formState.errors.phone.message}

} +
+
+
+ + + {form.formState.errors.subject &&

{form.formState.errors.subject.message}

} +
+
+ +