Files
ar.badieiandCursor c2376b3b9e
Build & Push Docker Image / build (push) Has been cancelled
feat: redesign landing page with brand system and section blocks
Refresh the homepage around new hero/services/roadmap sections, shared design tokens, and updated brand assets.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-23 17:00:55 +03:30

58 lines
1.6 KiB
TypeScript

"use client";
import type { TipBlockPayload } from "@/lib/blog-blocks";
import { Info, AlertTriangle, AlertCircle } from "lucide-react";
import { cn } from "@/lib/utils";
interface BlogTipProps {
payload: TipBlockPayload;
}
const variantConfig = {
info: {
icon: Info,
className:
"border-primary/40 bg-primary/5 text-foreground [&_strong]:text-primary",
iconClassName: "text-primary",
},
warn: {
icon: AlertTriangle,
className:
"border-secondary/40 bg-secondary/10 text-foreground [&_strong]:text-secondary dark:border-primary/40 dark:bg-primary/10 dark:[&_strong]:text-primary",
iconClassName: "text-secondary dark:text-primary",
},
danger: {
icon: AlertCircle,
className:
"border-destructive/50 bg-destructive/10 text-foreground [&_strong]:text-destructive",
iconClassName: "text-destructive",
},
} as const;
export function BlogTip({ payload }: BlogTipProps) {
const { variant, content } = payload;
if (!content.trim()) return null;
const config = variantConfig[variant ?? 'info'];
const Icon = config.icon;
return (
<div
className={cn(
"my-6 flex gap-3 rounded-blog border p-4 pe-4 shadow-sm",
config.className
)}
role="note"
>
<Icon
className={cn("mt-0.5 size-8 shrink-0", config.iconClassName)}
aria-hidden
/>
<div
className="blog-tip-content min-w-0 text-sm leading-relaxed [&_p]:my-2 [&_p:first-child]:mt-0 [&_p:last-child]:mb-0 [&_a]:text-primary [&_a]:underline hover:[&_a]:no-underline"
dangerouslySetInnerHTML={{ __html: content }}
/>
</div>
);
}