import{j as t}from"./markdown-9_JKOUHQ.js";import{s as u,a as j}from"./App-BEFplUGa.js";import{f,a as g,b as S,c as P,d as r,e as m,g as N}from"./command-DOlrnbnh.js";import{u as v,a as l,c as C}from"./use-ws-BIe6kKa2.js";import{u as w}from"./input-Dyxe5hqI.js";import{F as b}from"./folder-open-BbwqJxUi.js";import{d as $}from"./index-Z_QI94Zg.js";import"./mermaid-C0IQv4mH.js";import"./button-D8qrc3hb.js";import"./createLucideIcon-CsWFljth.js";import"./x-AprddF_b.js";import"./terminal-CuAYwdh-.js";import"./internal-editor-store-CuhCMFlj.js";import"./dialog-DapeOKPE.js";import"./search-JGV9EPmW.js";function A({open:c,onOpenChange:a}){const{t:s}=w(),n=$(),o=v(e=>e.projects),i=l(e=>e.startNewThread),d=l(e=>e.setSettingsOpen),p=e=>{a(!1),i(e),C.getState().fetchForProject(e),n(`/projects/${e}`)},x=e=>{a(!1),d(!0),n(`/settings/${e}`)};return t.jsxs(f,{open:c,onOpenChange:a,children:[t.jsx(g,{placeholder:s("commandPalette.searchPlaceholder")}),t.jsxs(S,{children:[t.jsx(P,{children:s("commandPalette.noResults")}),t.jsx(r,{heading:s("commandPalette.projects"),children:o.length===0?t.jsx("div",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:s("commandPalette.noProjects")}):o.map(e=>t.jsxs(m,{value:`${e.name} ${e.path}`,onSelect:()=>p(e.id),children:[t.jsx(b,{className:"h-4 w-4 flex-shrink-0"}),t.jsxs("div",{className:"flex min-w-0 flex-col",children:[t.jsx("span",{className:"truncate",children:e.name}),t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:e.path})]})]},e.id))}),t.jsx(N,{}),t.jsx(r,{heading:s("commandPalette.settings"),children:u.map(e=>{const h=e.icon;return t.jsxs(m,{value:e.label,onSelect:()=>x(e.id),children:[t.jsx(h,{className:"h-4 w-4"}),t.jsx("span",{children:s(j[e.id]??e.label)})]},e.id)})})]})]})}export{A as CommandPalette};
