@@ -101,13 +175,24 @@ export default async function Home() {
{settings?.cta_description ??
"İhtiyacınızı dinleyip size en uygun çözümü öneren bir ekip arıyorsanız, ilk görüşme bizden."}
-
- {settings?.cta_button_label ?? "Ücretsiz keşif görüşmesi"}
-
-
+
>
diff --git a/app/actions.ts b/app/actions.ts
index 3299b16..28e7cfe 100644
--- a/app/actions.ts
+++ b/app/actions.ts
@@ -19,14 +19,23 @@ export async function submitContact(
const phone = String(formData.get("phone") ?? "").trim();
const subject = String(formData.get("subject") ?? "").trim();
const message = String(formData.get("message") ?? "").trim();
+ const source = String(formData.get("source") ?? "").trim();
const errors: Record
= {};
if (!name) errors.name = "Ad zorunlu";
- if (!email) errors.email = "E-posta zorunlu";
- else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email))
+
+ // E-posta YA DA telefon biri yeterli (quick lead form için)
+ if (!email && !phone) {
+ errors.email = "E-posta veya telefon zorunlu";
+ } else if (email && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
errors.email = "Geçerli bir e-posta girin";
- if (!message || message.length < 10)
+ }
+
+ // Tam form değilse message zorunlu değil
+ const isQuickLead = source.startsWith("quick");
+ if (!isQuickLead && (!message || message.length < 10)) {
errors.message = "Mesaj en az 10 karakter olmalı";
+ }
if (Object.keys(errors).length > 0) {
return { ok: false, message: "Lütfen form alanlarını kontrol edin", errors };
@@ -35,15 +44,21 @@ export async function submitContact(
try {
await tablesDB.createRow(DATABASE_ID, TABLES.contactMessages, ID.unique(), {
name,
- email,
+ email: email || `${phone}@telefon.tr`, // email zorunlu — telefon-only ise placeholder
phone: phone || null,
- subject: subject || null,
- message,
+ subject: subject || (isQuickLead ? `Hızlı talep — ${source}` : null),
+ message:
+ message ||
+ (isQuickLead
+ ? `Hızlı lead: ${name} — ${phone || email}. Geri arama bekleniyor.`
+ : ""),
status: "new",
});
return {
ok: true,
- message: "Mesajınız iletildi. En kısa sürede dönüş yapacağız.",
+ message: isQuickLead
+ ? "Talebiniz alındı. En kısa sürede sizi arayacağız."
+ : "Mesajınız iletildi. En kısa sürede dönüş yapacağız.",
};
} catch (err) {
const detail = err instanceof Error ? err.message : "Bilinmeyen hata";
diff --git a/app/admin/(protected)/site/page.tsx b/app/admin/(protected)/site/page.tsx
index b1ddc41..cc07bfe 100644
--- a/app/admin/(protected)/site/page.tsx
+++ b/app/admin/(protected)/site/page.tsx
@@ -10,7 +10,12 @@ import {
} from "@/components/admin/form";
import { getSiteSettings } from "@/lib/data";
import { saveSiteSettings } from "@/lib/admin-actions";
-import type { StatItem } from "@/lib/types";
+import type {
+ ProcessStep,
+ StatItem,
+ TrustItem,
+ WhyUsItem,
+} from "@/lib/types";
export const metadata: Metadata = { title: "Site Ayarları" };
@@ -28,6 +33,61 @@ function statsToText(items?: string[] | null): string {
return parsed.map((s) => `${s.value} | ${s.label}`).join("\n");
}
+function trustToText(items?: string[] | null): string {
+ if (!items) return "";
+ const parsed: TrustItem[] = [];
+ for (const raw of items) {
+ try {
+ const obj = JSON.parse(raw) as Partial;
+ if (obj.value && obj.label)
+ parsed.push({
+ icon: obj.icon ?? "Sparkles",
+ value: obj.value,
+ label: obj.label,
+ });
+ } catch {
+ /* ignore */
+ }
+ }
+ return parsed.map((t) => `${t.icon} | ${t.value} | ${t.label}`).join("\n");
+}
+
+function whyUsToText(items?: string[] | null): string {
+ if (!items) return "";
+ const parsed: WhyUsItem[] = [];
+ for (const raw of items) {
+ try {
+ const obj = JSON.parse(raw) as Partial;
+ if (obj.title && obj.description)
+ parsed.push({
+ icon: obj.icon ?? "Sparkles",
+ title: obj.title,
+ description: obj.description,
+ });
+ } catch {
+ /* ignore */
+ }
+ }
+ return parsed
+ .map((w) => `${w.icon} | ${w.title}\n${w.description}`)
+ .join("\n---\n");
+}
+
+function processToText(items?: string[] | null): string {
+ if (!items) return "";
+ const parsed: ProcessStep[] = [];
+ for (const raw of items) {
+ try {
+ const obj = JSON.parse(raw) as Partial;
+ if (obj.title && obj.description)
+ parsed.push({ title: obj.title, description: obj.description });
+ } catch {
+ /* ignore */
+ }
+ }
+ return parsed.map((p) => `${p.title}\n${p.description}`).join("\n---\n");
+}
+
function Section({
title,
description,
@@ -294,6 +354,109 @@ export default async function SiteSettingsPage() {
help="Logo altındaki kısa açıklama metni."
/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+