feat: tip component
This commit is contained in:
@@ -5,12 +5,13 @@ import { notFound } from "next/navigation";
|
||||
import { getPostBySlug, getFeaturedImageUrl, getRelatedPosts } from "@/lib/wp-api";
|
||||
import { formatDateShamsi } from "@/lib/format-date";
|
||||
import { ChevronRight } from "lucide-react";
|
||||
import type { CollapseBlockPayload, BlockquoteBlockPayload } from "@/lib/blog-blocks";
|
||||
import type { CollapseBlockPayload, BlockquoteBlockPayload, TipBlockPayload } from "@/lib/blog-blocks";
|
||||
import { parseContentHeadings, getReadingTimeMinutes } from "@/lib/blog-utils";
|
||||
import { BlogToc } from "@/components/blog-toc";
|
||||
import { BlogPostMeta } from "@/components/blog-post-meta";
|
||||
import { BlogCollapseSection } from "@/components/blog-collapse-section";
|
||||
import { BlogBlockquote } from "@/components/blog-blockquote";
|
||||
import { BlogTip } from "@/components/blog-tip";
|
||||
import { BlogPullquote } from "@/components/blog-pullquote";
|
||||
import { ScrollToTop } from "@/components/scroll-to-top";
|
||||
import { BlogPostCard } from "@/components/blog-post-card";
|
||||
@@ -88,7 +89,7 @@ export default async function BlogPostPage({ params }: BlogPostPageProps) {
|
||||
<div className="lg:grid lg:grid-cols-[16rem_1fr] lg:gap-10">
|
||||
<BlogToc items={toc} className="mb-6 lg:mb-0" />
|
||||
|
||||
<div className="min-w-0 max-w-3xl space-y-0">
|
||||
<div className="min-w-0 space-y-0">
|
||||
<div className="pb-8 md:pb-12">
|
||||
<nav className="mb-6" aria-label="مسیر">
|
||||
<Link
|
||||
@@ -130,6 +131,8 @@ export default async function BlogPostPage({ params }: BlogPostPageProps) {
|
||||
/>
|
||||
) : seg.blockType === "blockquote" ? (
|
||||
<BlogBlockquote key={i} payload={seg.payload as BlockquoteBlockPayload} />
|
||||
) : seg.blockType === "tip" ? (
|
||||
<BlogTip key={i} payload={seg.payload as TipBlockPayload} />
|
||||
) : (
|
||||
null
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user