PageSourceSearch

https://samhui.zo.space/assets/goin-0XfvyKTR.js

js samhui.zo.space collected 2026-10-03 05:09:20 UTC 2,926 bytes, 1 lines download raw bytes

1import{r as o,j as e}from"./index-wcHJDP7n.js";import{I as p}from"./image-SzRTvbci.js";import{L as g}from"./loader-circle-odIBswl4.js";import{S as b}from"./send-DRw-uvJl.js";import"./createLucideIcon-Bfd8HVjA.js";const h="fc267fd9ab5be2ee26c872e2df5e1ff1";function S(){const[s,m]=o.useState(""),[r,c]=o.useState(null),[u,x]=o.useState(!1),[l,a]=o.useState(null);async function f(t){if(t.preventDefault(),!s.trim())return;x(!0),a(null);const d=new FormData;d.append("text",s),r&&d.append("photo",r);try{const n=await fetch("/api/goin-publish",{method:"POST",headers:{"x-goin-token":h,Accept:"application/json"},body:d}),i=await n.json();n.ok&&i.success?(a({ok:!0,message:i.message}),m(""),c(null)):a({ok:!1,message:i.error||"發布失敗,請再試一次。"})}catch(n){a({ok:!1,message:String(n)})}finally{x(!1)}}return e.jsx("div",{className:"min-h-screen bg-background text-foreground flex items-start justify-center p-6 pt-16",children:e.jsxs("div",{className:"w-full max-w-xl bg-card border rounded-2xl p-6 shadow-sm",children:[e.jsx("h1",{className:"text-2xl font-bold mb-1",children:"LinkedIn 一鍵發布"}),e.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"貼上語音轉文字內容,可選加一張相片,撳掣即自動生成文章並發布到 LinkedIn。"}),e.jsxs("form",{onSubmit:f,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"語音轉文字內容"}),e.jsx("textarea",{value:s,onChange:t=>m(t.target.value),rows:8,placeholder:"喺度貼上你嘅語音轉文字內容……",className:"w-full rounded-lg border bg-background p-3 text-sm focus:outline-none focus:ring-2 focus:ring-primary",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"相片(可選)"}),e.jsxs("label",{className:"flex items-center gap-2 border rounded-lg p-3 text-sm cursor-pointer hover:bg-muted/50 transition",children:[e.jsx(p,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:r?r.name:"冇提供就純文字發帖"}),e.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:t=>c(t.target.files?.[0]||null)})]})]}),e.jsx("button",{type:"submit",disabled:u||!s.trim(),className:"w-full flex items-center justify-center gap-2 rounded-lg bg-primary text-primary-foreground py-3 font-medium disabled:opacity-50",children:u?e.jsxs(e.Fragment,{children:[e.jsx(g,{className:"w-4 h-4 animate-spin"})," 生成並發布中……"]}):e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"w-4 h-4"})," 生成並發布到 LinkedIn"]})})]}),l&&e.jsx("div",{className:`mt-5 rounded-lg p-4 text-sm whitespace-pre-wrap ${l.ok?"bg-green-500/10 text-green-700 dark:text-green-400 border border-green-500/20":"bg-red-500/10 text-red-700 dark:text-red-400 border border-red-500/20"}`,children:l.message})]})})}export{S as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.