f833d429fc
Backend altyapısı: - 4 yeni Appwrite tablosu: blog_posts, testimonials, seo_pages, seo_settings - Appwrite Storage bucket: kovak-yazilim-media (görsel yüklemeleri) - Appwrite Auth ile session cookie tabanlı koruma Admin paneli (/admin): - Login akışı (email/password) + protected layout - Dashboard: sayım kartları + hızlı aksiyonlar - Blog CRUD: markdown content, kapak görseli, draft/published, SEO alanları - Services CRUD: lucide ikon seçici - Projects CRUD: teknoloji etiketleri, live URL - Testimonials CRUD: puanlama - SEO yöneticisi: global ayarlar + sayfa bazlı override - Mesaj inbox: status filtreleme + güncelleme - Medya kütüphanesi: Appwrite Storage upload/delete Public: - /blog ve /blog/[slug] sayfaları (markdown render) - Anasayfaya Testimonials bölümü - Tüm public sayfalarda generateMetadata + seo_pages override - Header'a Blog linki Route yapısı: - app/(site)/ — public site, Header/Footer ortak - app/admin/login — auth dışı - app/admin/(protected)/ — requireUser() korumalı 23 route üretiliyor, public static, admin dynamic.
71 lines
2.0 KiB
TypeScript
71 lines
2.0 KiB
TypeScript
import { Save } from "lucide-react";
|
||
import {
|
||
Checkbox,
|
||
Field,
|
||
FormActions,
|
||
FormShell,
|
||
GhostLink,
|
||
PageHeader,
|
||
PrimaryButton,
|
||
Textarea,
|
||
} from "@/components/admin/form";
|
||
import { saveSeoPage } from "@/lib/admin-actions";
|
||
import type { SeoPageRow } from "@/lib/types";
|
||
|
||
export function SeoPageForm({ row }: { row?: SeoPageRow }) {
|
||
return (
|
||
<div>
|
||
<PageHeader
|
||
title={row ? "Sayfa SEO override" : "Yeni sayfa SEO override"}
|
||
backHref="/admin/seo"
|
||
description="Sadece bu path için title/description/og bilgisini değiştir."
|
||
/>
|
||
<form action={saveSeoPage}>
|
||
{row && <input type="hidden" name="id" value={row.$id} />}
|
||
<FormShell>
|
||
<div className="grid gap-5">
|
||
<Field
|
||
label="Sayfa yolu (path)"
|
||
name="path"
|
||
required
|
||
defaultValue={row?.path}
|
||
placeholder="/hizmetler"
|
||
help="Örn: /, /hizmetler, /blog/yeni-yazi"
|
||
/>
|
||
<Field label="Başlık" name="title" defaultValue={row?.title} />
|
||
<Textarea
|
||
label="Açıklama"
|
||
name="description"
|
||
rows={3}
|
||
defaultValue={row?.description}
|
||
/>
|
||
<Field
|
||
label="OG görseli"
|
||
name="og_image"
|
||
type="url"
|
||
defaultValue={row?.og_image}
|
||
/>
|
||
<Field
|
||
label="Canonical URL"
|
||
name="canonical"
|
||
type="url"
|
||
defaultValue={row?.canonical}
|
||
/>
|
||
<Checkbox
|
||
label="Aramada gizle (noindex)"
|
||
name="noindex"
|
||
defaultChecked={row?.noindex ?? false}
|
||
/>
|
||
</div>
|
||
<FormActions>
|
||
<GhostLink href="/admin/seo">İptal</GhostLink>
|
||
<PrimaryButton>
|
||
<Save className="size-4" /> Kaydet
|
||
</PrimaryButton>
|
||
</FormActions>
|
||
</FormShell>
|
||
</form>
|
||
</div>
|
||
);
|
||
}
|