{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "linkedin-post-mockup",
  "title": "LinkedIn Post Mockup",
  "description": "A realistic LinkedIn post with a headline, media image, a reaction summary, and interactive like/repost actions with live counts, in light or dark theme.",
  "dependencies": [
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/linkedin-post-mockup/linkedin-post-mockup.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport type LinkedInPostMockupTheme = \"light\" | \"dark\";\n\nexport interface LinkedInPostMockupProps extends Omit<React.ComponentPropsWithoutRef<\"div\">, \"children\"> {\n  theme?: LinkedInPostMockupTheme;\n  borderRadius?: number;\n  username?: string;\n  headline?: string;\n  userAvatar?: string;\n  timePosted?: string;\n  postText?: string;\n  mediaImage?: string;\n  likesCount?: number;\n  commentsCount?: number;\n  repostsCount?: number;\n  showCounts?: boolean;\n  allowLike?: boolean;\n  allowRepost?: boolean;\n}\n\nfunction fmt(n: number): string {\n  if (n >= 1_000_000) return (n / 1_000_000).toFixed(1).replace(\".0\", \"\") + \"M\";\n  if (n >= 1_000) return (n / 1_000).toFixed(1).replace(\".0\", \"\") + \"K\";\n  return n.toLocaleString();\n}\n\nconst LiThumbsUp = ({ filled, size = 20, c = \"currentColor\" }: { filled: boolean; size?: number; c?: string }) => (\n  <svg width={size} height={size} viewBox=\"0 0 24 24\" fill={filled ? \"#0a66c2\" : \"none\"} stroke={filled ? \"#0a66c2\" : c} strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n    <path d=\"M7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3v11zm3 0h7.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3H14V5a3 3 0 0 0-3-3l-4 9v11z\" />\n  </svg>\n);\nconst LiComment = ({ size = 20, c = \"currentColor\" }: { size?: number; c?: string }) => (\n  <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" stroke={c} strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n    <path d=\"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z\" />\n  </svg>\n);\nconst LiGlobe = ({ size = 12, c = \"currentColor\" }: { size?: number; c?: string }) => (\n  <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" stroke={c} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n    <circle cx=\"12\" cy=\"12\" r=\"10\" />\n    <line x1=\"2\" y1=\"12\" x2=\"22\" y2=\"12\" />\n    <path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\" />\n  </svg>\n);\nconst LiDots = ({ dark = false }: { dark?: boolean }) => (\n  <svg width={20} height={20} viewBox=\"0 0 24 24\" fill={dark ? \"#fff\" : \"#262626\"}>\n    <circle cx=\"5\" cy=\"12\" r=\"1.8\" />\n    <circle cx=\"12\" cy=\"12\" r=\"1.8\" />\n    <circle cx=\"19\" cy=\"12\" r=\"1.8\" />\n  </svg>\n);\nconst LiRepost = ({ size = 26, dark = false, active = false }: { size?: number; dark?: boolean; active?: boolean }) => (\n  <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" stroke={active ? \"#00ba7c\" : dark ? \"#fff\" : \"#262626\"} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n    <path d=\"M17 1l4 4-4 4\" />\n    <path d=\"M3 11V9a4 4 0 0 1 4-4h14\" />\n    <path d=\"M7 23l-4-4 4-4\" />\n    <path d=\"M21 13v2a4 4 0 0 1-4 4H3\" />\n  </svg>\n);\nconst LiSend = ({ size = 26, dark = false }: { size?: number; dark?: boolean }) => (\n  <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" stroke={dark ? \"#fff\" : \"#262626\"} strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n    <path d=\"M4.36 8.175 L19.64 2.825 Q22 2 21.175 4.36 L15.825 19.64 Q15 22 13.985 19.715 L12.015 15.285 Q11 13 8.715 11.985 L4.285 10.015 Q2 9 4.36 8.175 Z\" />\n    <line x1=\"22\" y1=\"2\" x2=\"11\" y2=\"13\" />\n  </svg>\n);\n\nfunction ActionButton({ icon, label, onClick, active, sub }: { icon: React.ReactNode; label: string; onClick?: () => void; active?: boolean; sub: string }) {\n  return (\n    <button\n      onClick={onClick}\n      className=\"flex flex-1 items-center justify-center gap-1.5 rounded border-0 bg-transparent px-1 py-2.5 text-sm font-semibold\"\n      style={{ cursor: onClick ? \"pointer\" : \"default\", color: active ? \"#0a66c2\" : sub }}\n    >\n      {icon}\n      {label}\n    </button>\n  );\n}\n\nexport function LinkedInPostMockup({\n  theme = \"light\",\n  borderRadius = 8,\n  username = \"Joshua Json\",\n  headline = \"Product Designer at Framer\",\n  userAvatar,\n  timePosted = \"2h\",\n  postText = \"Excited to share that we just launched our new product 🚀 Big thanks to the team for the hard work!\",\n  mediaImage,\n  likesCount = 482,\n  commentsCount = 36,\n  repostsCount = 8,\n  showCounts = true,\n  allowLike = true,\n  allowRepost = true,\n  className,\n  style,\n  ...props\n}: LinkedInPostMockupProps) {\n  const [liked, setLiked] = React.useState(false);\n  const [reposted, setReposted] = React.useState(false);\n\n  const dark = theme === \"dark\";\n  const bg = dark ? \"#1b1f23\" : \"#fff\";\n  const text = dark ? \"rgba(255,255,255,0.9)\" : \"rgba(0,0,0,0.9)\";\n  const sub = dark ? \"rgba(255,255,255,0.6)\" : \"rgba(0,0,0,0.6)\";\n  const border = dark ? \"#38434f\" : \"#e9e5df\";\n\n  const likes = liked ? likesCount + 1 : likesCount;\n  const reposts = reposted ? repostsCount + 1 : repostsCount;\n\n  return (\n    <div\n      className={cn(\"box-border w-full overflow-hidden font-[-apple-system,BlinkMacSystemFont,'Segoe_UI',sans-serif]\", className)}\n      style={{ background: bg, borderRadius, border: `1px solid ${border}`, ...style }}\n      {...props}\n    >\n      <div className=\"flex items-start gap-2.5 px-4 pt-3 pb-2\">\n        <div className=\"h-12 w-12 shrink-0 overflow-hidden rounded-full\" style={{ background: dark ? \"#333\" : \"#ddd\" }}>\n          {userAvatar && <img src={userAvatar} alt={username} className=\"block h-full w-full object-cover\" />}\n        </div>\n        <div className=\"min-w-0 flex-1\">\n          <div className=\"text-sm font-semibold\" style={{ color: text }}>\n            {username}\n          </div>\n          {headline && (\n            <div className=\"mt-px text-xs leading-[1.35]\" style={{ color: sub }}>\n              {headline}\n            </div>\n          )}\n          <div className=\"mt-0.5 flex items-center gap-1 text-xs\" style={{ color: sub }}>\n            <span>{timePosted}</span>\n            <span>·</span>\n            <LiGlobe size={12} c={sub} />\n          </div>\n        </div>\n        <LiDots dark={dark} />\n      </div>\n\n      {postText && (\n        <div className=\"px-4 pb-2.5 text-sm leading-[1.5] whitespace-pre-wrap\" style={{ color: text }}>\n          {postText}\n        </div>\n      )}\n\n      {mediaImage && <img src={mediaImage} alt=\"Post media\" className=\"block max-h-[360px] w-full object-cover\" />}\n\n      {showCounts && (likes > 0 || commentsCount > 0 || reposts > 0) && (\n        <div className=\"flex items-center justify-between px-4 pt-2.5 pb-2 text-xs\" style={{ color: sub }}>\n          <div className=\"flex items-center gap-[5px]\">\n            {likes > 0 && (\n              <>\n                <div className=\"flex h-4 w-4 shrink-0 items-center justify-center rounded-full\" style={{ background: \"#0a66c2\" }}>\n                  <LiThumbsUp filled size={10} />\n                </div>\n                <span>{fmt(likes)}</span>\n              </>\n            )}\n          </div>\n          <div>{[commentsCount > 0 ? `${fmt(commentsCount)} comments` : null, reposts > 0 ? `${fmt(reposts)} reposts` : null].filter(Boolean).join(\" · \")}</div>\n        </div>\n      )}\n\n      <div className=\"mx-4 h-px\" style={{ background: border }} />\n\n      <div className=\"flex px-2 py-0.5\">\n        <ActionButton icon={<LiThumbsUp filled={liked} size={18} c={sub} />} label=\"Like\" active={liked} onClick={() => allowLike && setLiked((v) => !v)} sub={sub} />\n        <ActionButton icon={<LiComment size={18} c={sub} />} label=\"Comment\" sub={sub} />\n        <ActionButton icon={<LiRepost size={18} dark={dark} />} label=\"Repost\" active={reposted} onClick={() => allowRepost && setReposted((v) => !v)} sub={sub} />\n        <ActionButton icon={<LiSend size={18} dark={dark} />} label=\"Send\" sub={sub} />\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}