{"sha":"ef7e40b4fd1f2690a1b582ae4f07e73f1b5253c5","node_id":"C_kwDORD3Y59oAKGVmN2U0MGI0ZmQxZjI2OTBhMWI1ODJhZTRmMDdlNzNmMWI1MjUzYzU","commit":{"author":{"name":"gizzy","email":"me@gizzy.pro","date":"2026-01-31T13:39:24Z"},"committer":{"name":"gizzy","email":"me@gizzy.pro","date":"2026-01-31T13:39:24Z"},"message":"fix: add copy button","tree":{"sha":"96b2896adb17317417ba73d1c69ff67ed71019ef","url":"https://api.github.com/repos/GizzyUwU/govgiz/git/trees/96b2896adb17317417ba73d1c69ff67ed71019ef"},"url":"https://api.github.com/repos/GizzyUwU/govgiz/git/commits/ef7e40b4fd1f2690a1b582ae4f07e73f1b5253c5","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null,"verified_at":null}},"url":"https://api.github.com/repos/GizzyUwU/govgiz/commits/ef7e40b4fd1f2690a1b582ae4f07e73f1b5253c5","html_url":"https://github.com/GizzyUwU/govgiz/commit/ef7e40b4fd1f2690a1b582ae4f07e73f1b5253c5","comments_url":"https://api.github.com/repos/GizzyUwU/govgiz/commits/ef7e40b4fd1f2690a1b582ae4f07e73f1b5253c5/comments","author":{"login":"GizzyUwU","id":61115942,"node_id":"MDQ6VXNlcjYxMTE1OTQy","avatar_url":"https://avatars.githubusercontent.com/u/61115942?v=4","gravatar_id":"","url":"https://api.github.com/users/GizzyUwU","html_url":"https://github.com/GizzyUwU","followers_url":"https://api.github.com/users/GizzyUwU/followers","following_url":"https://api.github.com/users/GizzyUwU/following{/other_user}","gists_url":"https://api.github.com/users/GizzyUwU/gists{/gist_id}","starred_url":"https://api.github.com/users/GizzyUwU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GizzyUwU/subscriptions","organizations_url":"https://api.github.com/users/GizzyUwU/orgs","repos_url":"https://api.github.com/users/GizzyUwU/repos","events_url":"https://api.github.com/users/GizzyUwU/events{/privacy}","received_events_url":"https://api.github.com/users/GizzyUwU/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"GizzyUwU","id":61115942,"node_id":"MDQ6VXNlcjYxMTE1OTQy","avatar_url":"https://avatars.githubusercontent.com/u/61115942?v=4","gravatar_id":"","url":"https://api.github.com/users/GizzyUwU","html_url":"https://github.com/GizzyUwU","followers_url":"https://api.github.com/users/GizzyUwU/followers","following_url":"https://api.github.com/users/GizzyUwU/following{/other_user}","gists_url":"https://api.github.com/users/GizzyUwU/gists{/gist_id}","starred_url":"https://api.github.com/users/GizzyUwU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GizzyUwU/subscriptions","organizations_url":"https://api.github.com/users/GizzyUwU/orgs","repos_url":"https://api.github.com/users/GizzyUwU/repos","events_url":"https://api.github.com/users/GizzyUwU/events{/privacy}","received_events_url":"https://api.github.com/users/GizzyUwU/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"e9a8925f9231576beba86f8bc69d793421f1d932","url":"https://api.github.com/repos/GizzyUwU/govgiz/commits/e9a8925f9231576beba86f8bc69d793421f1d932","html_url":"https://github.com/GizzyUwU/govgiz/commit/e9a8925f9231576beba86f8bc69d793421f1d932"}],"stats":{"total":38,"additions":28,"deletions":10},"files":[{"sha":"9645b393322ef22950c97c473b61b0c50f60b9fb","filename":"src/components/Markdown.tsx","status":"modified","additions":28,"deletions":10,"changes":38,"blob_url":"https://github.com/GizzyUwU/govgiz/blob/ef7e40b4fd1f2690a1b582ae4f07e73f1b5253c5/src%2Fcomponents%2FMarkdown.tsx","raw_url":"https://github.com/GizzyUwU/govgiz/raw/ef7e40b4fd1f2690a1b582ae4f07e73f1b5253c5/src%2Fcomponents%2FMarkdown.tsx","contents_url":"https://api.github.com/repos/GizzyUwU/govgiz/contents/src%2Fcomponents%2FMarkdown.tsx?ref=ef7e40b4fd1f2690a1b582ae4f07e73f1b5253c5","patch":"@@ -52,7 +52,6 @@ const Pre: ParentComponent<{\n   let ref!: HTMLPreElement;\n   let divRef!: HTMLDivElement;\n \n-\n   const onCopy = () => {\n     setCopied(true);\n     navigator.clipboard.writeText(ref.innerText);\n@@ -70,28 +69,47 @@ const Pre: ParentComponent<{\n     <div class=\"govuk-tabs\" data-module=\"govuk-tabs\">\n       <h2 class=\"govuk-tabs__title\">Contents</h2>\n       <ul class=\"govuk-tabs__list\">\n-        <li class={`govuk-tabs__list-item ${open() ? \"govuk-tabs__list-item--selected\" : \"\"}`}>\n-          <a class=\"govuk-tabs__tab\" style={{\n-\t\t\t\"text-decoration\": \"none\"\n-\t\t  }} href=\"#\" onClick={toggle}>\n+        <li\n+          class={`govuk-tabs__list-item ${open() ? \"govuk-tabs__list-item--selected\" : \"\"}`}\n+        >\n+          <a\n+            class=\"govuk-tabs__tab\"\n+            style={{\n+              \"text-decoration\": \"none\",\n+            }}\n+            href=\"#\"\n+            onClick={toggle}\n+          >\n             {props.displayLang}\n           </a>\n         </li>\n       </ul>\n-      <div class=\"govuk-tabs__panel\" ref={divRef} style={{ display: open() ? \"block\" : \"none\" }}>\n-        <button type=\"button\" onClick={onCopy}>\n-          {copied() ? \"Copied!\" : \"Copy code\"}\n-        </button>\n+      <div class=\"govuk-tabs__panel \" ref={divRef} style={{ display: open() ? \"block\" : \"none\" }}>\n         <pre\n           ref={ref}\n           class={`language-${props.lang}`}\n           data-line={props.lines}\n           style={{\n-            display: \"block\",\n+            position: \"relative\",\n             margin: 0,\n             \"overflow-x\": \"auto\",\n+            \"padding-top\": \"3rem\",\n           }}\n         >\n+          <button\n+            type=\"button\"\n+            class=\"govuk-button\"\n+            data-module=\"govuk-button\"\n+            style={{\n+              position: \"absolute\",\n+              top: \"0.4rem\",\n+              right: \"0.5rem\",\n+              margin: 0,\n+            }}\n+\t\t\tonClick={onCopy}\n+          >\n+            {copied() ? \"Copied!\" : \"Copy code\"}\n+          </button>\n           {props.children}\n         </pre>\n       </div>"}]}