{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "media-11",
  "type": "registry:block",
  "description": "Podcast episode with a sticky player bar and a clickable, auto-highlighting transcript.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/designali/blocks/media/media-11.tsx",
      "content": "\"use client\"\n\nimport { useEffect, useState } from \"react\"\nimport { Pause, Play, Rewind, FastForward } from \"@designali/icons\"\n\nimport { cn } from \"@workspace/ui/lib/utils\"\n\nconst segments = [\n  {\n    at: 0,\n    speaker: \"Ali\",\n    text: \"Welcome back to the Designali Podcast, the show about design, code and the space between. I'm Ali Imam.\",\n  },\n  {\n    at: 9,\n    speaker: \"Ali\",\n    text: \"Today I'm with Rafael, a designer who recently started shipping his own websites in code.\",\n  },\n  {\n    at: 18,\n    speaker: \"Rafael\",\n    text: \"Thanks for having me. I've been a long-time user of the Designali blocks.\",\n  },\n  {\n    at: 25,\n    speaker: \"Ali\",\n    text: \"Let's start with the handoff. Why did you stop handing designs to developers?\",\n  },\n  {\n    at: 32,\n    speaker: \"Rafael\",\n    text: \"Because the handoff was the hardest part of every project, not the design itself.\",\n  },\n  {\n    at: 42,\n    speaker: \"Rafael\",\n    text: \"Every time a Figma file became code, something got lost. Spacing, motion, the small details.\",\n  },\n  {\n    at: 52,\n    speaker: \"Ali\",\n    text: \"That's exactly why I started Designali. Design se code tak, without losing anything.\",\n  },\n  {\n    at: 58,\n    speaker: \"Rafael\",\n    text: \"Now I start from a block, tweak the tokens and ship. It saves me days on every site.\",\n  },\n]\nconst DURATION = 70\nconst fmt = (s: number) =>\n  `${Math.floor(s / 60)}:${String(Math.floor(s) % 60).padStart(2, \"0\")}`\n\nexport default function Media11() {\n  const [time, setTime] = useState(18)\n  const [playing, setPlaying] = useState(false)\n\n  useEffect(() => {\n    if (!playing) return\n    const id = setInterval(\n      () => setTime((t) => (t + 1 > DURATION ? 0 : t + 1)),\n      1000\n    )\n    return () => clearInterval(id)\n  }, [playing])\n\n  const activeIndex = segments.reduce(\n    (acc, s, i) => (time >= s.at ? i : acc),\n    0\n  )\n\n  return (\n    <section className=\"w-full bg-background py-20\">\n      <div className=\"mx-auto max-w-3xl px-6\">\n        <div className=\"flex items-center gap-4\">\n          <img\n            src=\"/img/ask/ask5.jpg\"\n            alt=\"Designali Podcast cover art\"\n            className=\"size-16 shrink-0 border border-border object-cover\"\n          />\n          <div className=\"min-w-0\">\n            <p className=\"text-xs text-muted-foreground\">\n              Designali Podcast - Episode 87\n            </p>\n            <h2 className=\"truncate text-xl font-semibold tracking-tight md:text-2xl\">\n              Design se code tak, without the handoff\n            </h2>\n          </div>\n        </div>\n        <div className=\"sticky top-0 z-10 mt-6 border border-border bg-background/95 p-4 backdrop-blur\">\n          <div className=\"flex items-center gap-3\">\n            <button\n              type=\"button\"\n              aria-label=\"Back 15 seconds\"\n              onClick={() => setTime((t) => Math.max(0, t - 15))}\n              className=\"p-1.5 text-muted-foreground hover:text-foreground\"\n            >\n              <Rewind className=\"size-4\" />\n            </button>\n            <button\n              type=\"button\"\n              aria-label={playing ? \"Pause\" : \"Play\"}\n              onClick={() => setPlaying((p) => !p)}\n              className=\"flex size-10 shrink-0 items-center justify-center rounded-full bg-foreground text-background\"\n            >\n              {playing ? (\n                <Pause className=\"size-4 fill-current\" />\n              ) : (\n                <Play className=\"size-4 translate-x-px fill-current\" />\n              )}\n            </button>\n            <button\n              type=\"button\"\n              aria-label=\"Forward 15 seconds\"\n              onClick={() => setTime((t) => Math.min(DURATION, t + 15))}\n              className=\"p-1.5 text-muted-foreground hover:text-foreground\"\n            >\n              <FastForward className=\"size-4\" />\n            </button>\n            <div className=\"flex min-w-0 flex-1 items-center gap-3\">\n              <span className=\"font-sans text-xs tabular-nums\">\n                {fmt(time)}\n              </span>\n              <input\n                type=\"range\"\n                min={0}\n                max={DURATION}\n                value={time}\n                onChange={(e) => setTime(Number(e.target.value))}\n                aria-label=\"Seek\"\n                className=\"h-1 min-w-0 flex-1 cursor-pointer accent-foreground\"\n              />\n              <span className=\"hidden font-sans text-xs text-muted-foreground tabular-nums sm:inline\">\n                {fmt(DURATION)}\n              </span>\n            </div>\n          </div>\n        </div>\n        <div className=\"mt-8\">\n          <p className=\"text-xs tracking-widest text-muted-foreground uppercase\">\n            Transcript - click a line to jump\n          </p>\n          <ol className=\"mt-4 space-y-1\">\n            {segments.map((s, i) => (\n              <li key={s.at}>\n                <button\n                  type=\"button\"\n                  onClick={() => setTime(s.at)}\n                  className={cn(\n                    \"grid w-full grid-cols-[3rem_1fr] gap-3 border-l-2 px-3 py-2.5 text-left transition-colors sm:grid-cols-[3rem_5rem_1fr]\",\n                    i === activeIndex\n                      ? \"border-foreground bg-muted\"\n                      : \"border-transparent hover:bg-muted/50\",\n                    i > activeIndex && \"text-muted-foreground\"\n                  )}\n                >\n                  <span className=\"pt-0.5 font-sans text-xs text-muted-foreground tabular-nums\">\n                    {fmt(s.at)}\n                  </span>\n                  <span className=\"hidden text-sm font-medium sm:block\">\n                    {s.speaker}\n                  </span>\n                  <span className=\"text-sm leading-relaxed\">\n                    <span className=\"font-medium sm:hidden\">{s.speaker}: </span>\n                    {s.text}\n                  </span>\n                </button>\n              </li>\n            ))}\n          </ol>\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "iframeHeight": "950px"
  },
  "categories": [
    "media"
  ]
}