Spaces:
Running
Running
| import{r as a,j as e}from"./react-D_B_5QVd.js";import{y as u,G as f,L as x,M as p}from"./index-BdwitBZy.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const b=`commit 3a4b5c... | |
| Author: Dev One <dev.one@example.com> | |
| Date: Mon Jul 15 11:30:00 2024 -0400 | |
| feat: add user login page | |
| commit 1a2b3c... | |
| Author: Dev Two <dev.two@example.com> | |
| Date: Mon Jul 15 10:00:00 2024 -0400 | |
| fix: correct typo in header | |
| `,L=()=>{const[s,d]=a.useState(b),[r,n]=a.useState(""),[o,c]=a.useState(!1),[i,l]=a.useState(""),g=a.useCallback(async()=>{if(!s.trim()){l("Please paste your git log output.");return}c(!0),l(""),n("");try{const t=u(s);let m="";for await(const h of t)m+=h,n(m)}catch(t){l(t instanceof Error?t.message:"An unknown error occurred.")}finally{c(!1)}},[s]);return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8 text-text-primary",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center",children:[e.jsx(f,{}),e.jsx("span",{className:"ml-3",children:"AI Changelog Generator"})]}),e.jsx("p",{className:"text-text-secondary mt-1",children:"Generate a markdown changelog from your raw git log."})]}),e.jsxs("div",{className:"flex-grow flex flex-col gap-4 min-h-0",children:[e.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[e.jsx("label",{htmlFor:"commit-input",className:"text-sm font-medium text-text-secondary mb-2",children:"Raw Git Log"}),e.jsx("textarea",{id:"commit-input",value:s,onChange:t=>d(t.target.value),className:"flex-grow p-4 bg-surface border border-border rounded-md resize-none font-mono text-sm"})]}),e.jsx("div",{className:"flex-shrink-0",children:e.jsx("button",{onClick:g,disabled:o,className:"btn-primary w-full max-w-xs mx-auto flex items-center justify-center px-6 py-3",children:o?e.jsx(x,{}):"Generate Changelog"})}),e.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[e.jsx("label",{className:"text-sm font-medium text-text-secondary mb-2",children:"Generated Changelog.md"}),e.jsxs("div",{className:"relative flex-grow p-4 bg-background border border-border rounded-md overflow-y-auto",children:[o&&!r&&e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx(x,{})}),i&&e.jsx("p",{className:"text-red-500",children:i}),r&&e.jsx(p,{content:r}),!o&&r&&e.jsx("button",{onClick:()=>navigator.clipboard.writeText(r),className:"absolute top-2 right-2 px-2 py-1 bg-gray-100 text-xs rounded-md hover:bg-gray-200",children:"Copy"})]})]})]})]})};export{L as ChangelogGenerator}; | |
| //# sourceMappingURL=ChangelogGenerator-BR9dmkLS.js.map | |