import{et as e,i as t,r as n,st as r,ut as i}from"./branding-ClCX8iZg.js";import{E as a}from"./index-CQbBgNYK.js";import{t as o}from"./HeaderApp-HWu4NOgP.js";import{t as s}from"./use-document-meta-Br4UMxjt.js";import{t as c}from"./api-toast-BFyXHsNH.js";import{n as l,t as u}from"./textarea-CU-rr98-.js";var d=i(r(),1),f=t();function p(){let t=e(),[r,i]=(0,d.useState)(``),[p,m]=(0,d.useState)(``),[h,g]=(0,d.useState)(!1);s({title:`New Secret`,description:`Create a new encrypted secret.`});function _(){g(!0),c(l({key:r.trim(),value:p.trim()}),{loading:`Creating secret...`,success:`Secret created`,error:`Failed to create secret`}).then(()=>t(`/secrets`)).catch(()=>{}).finally(()=>g(!1))}let v=r.trim().length>0&&p.trim().length>0&&!h;return(0,f.jsx)(o,{title:`New Secret`,description:`Create a new encrypted secret.`,children:(0,f.jsxs)(`div`,{className:`max-w-lg space-y-6`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`label`,{htmlFor:`secret-key`,className:`text-sm font-medium`,children:`Key`}),(0,f.jsx)(a,{id:`secret-key`,placeholder:`e.g., STRIPE_SECRET_KEY`,value:r,onChange:e=>i(e.target.value),className:`mt-1`}),(0,f.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:`A unique identifier for this secret`})]}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`label`,{htmlFor:`secret-value`,className:`text-sm font-medium`,children:`Value`}),(0,f.jsx)(u,{id:`secret-value`,placeholder:`Enter the secret value (API key, token, etc.)`,value:p,onChange:e=>m(e.target.value),className:`mt-1`,rows:4}),(0,f.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:`Store tokens, API keys, passwords, or any sensitive data`})]}),(0,f.jsxs)(`div`,{className:`flex gap-3`,children:[(0,f.jsx)(n,{variant:`outline`,onClick:()=>t(`/secrets`),children:`Cancel`}),(0,f.jsx)(n,{onClick:_,disabled:!v,children:h?`Creating...`:`Create Secret`})]})]})})}export{p as Component};