import{y as o,n as e}from"./components-DjjSZ9bp.js";function l(){const{history:t}=o(),n=s=>{const r=new Date(s);return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(r)};return e.jsxs("div",{className:"container",children:[e.jsxs("h1",{style:{marginBottom:"var(--space-6)"},children:[e.jsx("span",{style:{color:"var(--color-info)"},children:"≡"})," Command Logs"]}),e.jsxs("div",{className:"card",children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--space-4)"},children:[e.jsx("h3",{className:"card-title",style:{marginBottom:0},children:"Command History"}),e.jsxs("div",{style:{display:"flex",gap:"var(--space-2)"},children:[e.jsxs("button",{className:"btn btn-secondary",disabled:!0,children:[e.jsx("span",{children:"⬇"}),e.jsx("span",{children:"Export CSV"})]}),e.jsxs("button",{className:"btn btn-danger",disabled:!0,children:[e.jsx("span",{children:"🗑"}),e.jsx("span",{children:"Clear"})]})]})]}),t.length===0?e.jsxs("div",{className:"terminal",style:{textAlign:"center",color:"var(--color-text-muted)"},children:[e.jsx("p",{children:"No command history yet."}),e.jsxs("p",{style:{fontSize:"0.875rem",marginTop:"var(--space-2)"},children:["Execute commands from the"," ",e.jsx("a",{href:"/commands",children:"Commands page"})," ","to see them here."]})]}):e.jsx("div",{style:{overflowX:"auto"},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{style:{borderBottom:"1px solid var(--color-border)"},children:[e.jsx("th",{style:{padding:"var(--space-3)",textAlign:"left",color:"var(--color-text-secondary)",fontSize:"0.75rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Time"}),e.jsx("th",{style:{padding:"var(--space-3)",textAlign:"left",color:"var(--color-text-secondary)",fontSize:"0.75rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Command"}),e.jsx("th",{style:{padding:"var(--space-3)",textAlign:"left",color:"var(--color-text-secondary)",fontSize:"0.75rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Status"})]})}),e.jsx("tbody",{children:t.map((s,r)=>e.jsxs("tr",{style:{borderBottom:"1px solid var(--color-border)",transition:"background var(--transition-fast)"},onMouseEnter:a=>{a.currentTarget.style.background="var(--color-surface-hover)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[e.jsx("td",{style:{padding:"var(--space-3)",fontSize:"0.875rem",color:"var(--color-text-secondary)",fontFamily:"var(--font-mono)"},children:n(s.executed_at)}),e.jsx("td",{style:{padding:"var(--space-3)",fontFamily:"var(--font-mono)",fontSize:"0.875rem"},children:e.jsx("code",{style:{color:"var(--color-accent)"},children:s.command})}),e.jsx("td",{style:{padding:"var(--space-3)"},children:e.jsxs("span",{className:`badge ${s.success?"badge-success":"badge-error"}`,children:[e.jsx("span",{"aria-hidden":"true",children:s.success?"✓":"✗"}),s.success?"Success":"Failed"]})})]},s.id||r))})]})}),t.length>0&&e.jsxs("div",{style:{marginTop:"var(--space-4)",textAlign:"center",color:"var(--color-text-muted)",fontSize:"0.875rem"},children:["Showing ",t.length," recent commands"]})]}),e.jsxs("div",{className:"card",style:{marginTop:"var(--space-4)"},children:[e.jsx("h3",{className:"card-title",children:"System Logs"}),e.jsx("p",{className:"text-muted",children:"System log viewing will be available in a future update."}),e.jsxs("button",{className:"btn btn-secondary",disabled:!0,children:[e.jsx("span",{children:"📄"}),e.jsx("span",{children:"View System Logs"})]})]})]})}export{l as default};
