import { useBlogPost, useBlogPosts } from "@/hooks/use-blog"; import { usePageMeta } from "@/hooks/use-page-meta"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@sase/ui"; import { Link } from "@tanstack/react-router"; import { ChevronRight } from "lucide-react"; import ReactMarkdown from "react-markdown"; import remarkGfm from "remark-gfm"; // Blog content is rendered in two shells: the public marketing pages (/blog) // and the dashboard-wrapped pages (/dashboard/blog) so logged-in users keep // the sidebar. Only the internal link targets differ; the canonical URL always // points at the public page. type BlogListPath = "/blog" | "/dashboard/blog"; type BlogPostPath = "/blog/$slug" | "/dashboard/blog/$slug"; // ─── LIST ───────────────────────────────────────────────────────────────────── export function BlogListContent({ postLinkTo }: { postLinkTo: BlogPostPath }) { usePageMeta({ title: "Blog — Sase.tr | Şase & Yedek Parça Rehberi", description: "Şase numarası okuma, OEM vs muadil parça, dijital dönüşüm ve daha fazlası.", canonical: "https://sase.tr/blog", }); // All posts come from the central Directus CMS through the API. const { data: apiPosts, isLoading } = useBlogPosts(); const posts = (apiPosts ?? []) .map((p) => ({ slug: p.slug, title: p.title, description: p.metaDescription ?? "", date: p.publishedAt.slice(0, 10), })) .sort((a, b) => b.date.localeCompare(a.date)); return ( <>

Blog

Yedek parça sektörü, araç bakımı ve Sase.tr hakkında güncel yazılar.

{isLoading && posts.length === 0 && (

Yükleniyor…

)}
{posts.map((post) => ( {post.date} {post.title}

{post.description}

))}
); } // ─── POST ───────────────────────────────────────────────────────────────────── // Posts live in the central Directus CMS and arrive as markdown via the API. const mdComponents = { h2: (props: React.ComponentProps<"h2">) => (

), h3: (props: React.ComponentProps<"h3">) => (

), ul: (props: React.ComponentProps<"ul">) =>