{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "blog-2",
  "dependencies": [
    "lucide-react",
    "react-icons"
  ],
  "registryDependencies": [
    "button",
    "utils"
  ],
  "files": [
    {
      "path": "src/components/watermelon-ui/blog-2.tsx",
      "content": "import { ArrowRight, ArrowUpRight } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nimport { FaBookmark } from \"react-icons/fa6\";\n\ninterface BlogAuthor {\n  name: string;\n  role: string;\n  avatar: string;\n}\n\ninterface BlogCardItem {\n  meta: string;\n  title: string;\n  author: BlogAuthor;\n  href?: string;\n}\n\ninterface Blog2Header {\n  heading: string;\n  description: string;\n  ctaText: string;\n  ctaHref: string;\n}\n\ninterface Blog2Props {\n  header: Blog2Header;\n  posts: BlogCardItem[];\n  className?: string;\n  renderCtaLink?: (props: {\n    href: string;\n    children: React.ReactNode;\n  }) => React.ReactNode;\n  renderCardLink?: (props: {\n    href: string;\n    children: React.ReactNode;\n  }) => React.ReactNode;\n}\n\nconst colorVariants = [\n  \"bg-violet-400/60 hover:bg-violet-400/40 dark:bg-violet-400/50 dark:hover:bg-violet-400/40\",\n  \"bg-amber-400/60 hover:bg-amber-400/40 dark:bg-amber-400/50 dark:hover:bg-amber-400/40\",\n  \"bg-emerald-400/60 hover:bg-emerald-400/40 dark:bg-emerald-400/50 dark:hover:bg-emerald-400/40\",\n  \"bg-orange-400/60 hover:bg-orange-400/40 dark:bg-orange-400/50 dark:hover:bg-orange-400/40\",\n  \"bg-blue-400/60 hover:bg-blue-400/40 dark:bg-blue-400/50 dark:hover:bg-blue-400/40\",\n  \"bg-rose-400/60 hover:bg-rose-400/40 dark:bg-rose-400/50 dark:hover:bg-rose-400/40\",\n];\n\nexport default function Blog2({\n  header,\n  posts,\n  className,\n  renderCtaLink,\n  renderCardLink,\n}: Blog2Props) {\n  const ctaContent = (\n    <span className=\"group/cta text-primary hover:text-primary/80 inline-flex items-center gap-1.5 text-sm font-semibold transition-colors\">\n      {header.ctaText}\n      <ArrowUpRight className=\"size-4 transition-transform group-hover/cta:translate-x-0.5 group-hover/cta:-translate-y-0.5\" />\n    </span>\n  );\n\n  return (\n    <section className={cn(\"bg-background w-full  px-4 py-8\", className)}>\n      <div className=\"mx-auto max-w-6xl\">\n        <div className=\"mb-12 flex flex-col items-center gap-4 text-center md:mb-16\">\n          <h2 className=\"text-foreground max-w-2xl text-3xl leading-tight font-semibold tracking-tight sm:text-4xl md:text-[2.75rem]\">\n            {header.heading}\n          </h2>\n\n          <p className=\"text-muted-foreground max-w-lg text-sm leading-relaxed sm:text-base\">\n            {header.description}\n          </p>\n\n          {renderCtaLink ? (\n            renderCtaLink({ href: header.ctaHref, children: ctaContent })\n          ) : (\n            <a href={header.ctaHref}>{ctaContent}</a>\n          )}\n        </div>\n\n        <div className=\"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3\">\n          {posts.map((post, index) => {\n            const card = (\n              <article\n                key={index}\n                className={cn(\n                  \"group relative flex min-h-[360px] flex-col justify-between rounded-4xl p-6 transition-colors duration-300 sm:p-7\",\n                  colorVariants[index % colorVariants.length],\n                )}\n              >\n                <div className=\"flex flex-1 flex-col\">\n                  <div className=\"flex items-center justify-between\">\n                    <span className=\"text-foreground/80 text-md font-bold\">\n                      {post.meta}\n                    </span>\n                    <div className=\"text-foreground/50 hover:text-foreground/90 transition-colors\">\n                      <FaBookmark className=\"size-5\" strokeWidth={1.5} />\n                    </div>\n                  </div>\n\n                  <div className=\"flex flex-1 flex-col justify-center py-6\">\n                    <div className=\"flex items-start justify-between gap-4\">\n                      <h3 className=\"text-foreground line-clamp-3 text-4xl leading-[1.2] font-medium tracking-tight\">\n                        {post.title}\n                      </h3>\n                      <ArrowRight\n                        className=\"text-foreground group-hover:text-foreground/80 mt-10 size-5 shrink-0 transition-all duration-300 group-hover:translate-x-1\"\n                        strokeWidth={3}\n                      />\n                    </div>\n                  </div>\n                  <div className=\"flex items-center justify-between gap-2\">\n                    <div className=\"mt-auto flex items-center gap-3\">\n                      <div className=\"bg-background flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg\">\n                        {post.author.avatar.startsWith(\"<svg\") ||\n                        post.author.avatar.startsWith(\"http\") ? (\n                          <img\n                            src={post.author.avatar}\n                            alt={post.author.name}\n                            className=\"size-full rounded-lg object-contain\"\n                          />\n                        ) : (\n                          <div className=\"bg-muted flex size-full items-center justify-center rounded-full text-xs font-medium\">\n                            {post.author.name.charAt(0)}\n                          </div>\n                        )}\n                      </div>\n                    </div>\n                    <div className=\"flex flex-col\">\n                      <span className=\"text-foreground text-sm leading-tight font-medium\">\n                        {post.author.name}\n                      </span>\n                      <span className=\"text-foreground/70 text-xs leading-tight font-medium\">\n                        {post.author.role}\n                      </span>\n                    </div>\n                    <div className=\"ml-auto flex items-center justify-center rounded-md border border-white/30 bg-background/20 dark:bg-white/20 backdrop-blur-sm px-4 py-1.5 text-xs font-semibold text-zinc-50 transition-transform duration-300\">\n                      Read\n                    </div>\n                  </div>\n                </div>\n              </article>\n            );\n\n            if (renderCardLink && post.href) {\n              return renderCardLink({\n                href: post.href,\n                children: card,\n              });\n            }\n\n            if (post.href) {\n              return (\n                <a\n                  key={index}\n                  href={post.href}\n                  className=\"block focus-visible:ring-primary rounded-[1.5rem] focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none\"\n                >\n                  {card}\n                </a>\n              );\n            }\n\n            return card;\n          })}\n        </div>\n      </div>\n    </section>\n  );\n}\n",
      "type": "registry:ui",
      "target": "components/ui/blog-2.tsx"
    }
  ],
  "type": "registry:ui"
}
