import{a as e,l as t}from"./preact.module-CNakwbc9.js";import{d as n,l as r,p as i,s as a,t as o}from"./hooks.module-BrXTvcfS.js";import{G as s,N as c}from"./content_renderer-DOj8g78V.js";import{a as l,k as u}from"./i18n-BaLR3UdQ.js";import{t as d}from"./jsxRuntime.module-Cao1NCKs.js";import{o as f,r as p}from"./react_utils-Bz0ffU2Y.js";import{t as m}from"./note_autocomplete-BT55HtG6.js";import{t as h}from"./NoteAutocomplete-Cpc7J_0A.js";import{t as g}from"./FormGroup-DqPd4bBP.js";n(),t();function _({ntxId:t}){return d(e,{children:[d(x,{}),d(v,{ntxId:t??null})]})}function v({ntxId:e}){return u()?d(y,{}):d(b,{ntxId:e})}function y(){return d(`div`,{className:`empty-tab-search-mobile`,onClick:()=>s.triggerCommand(`jumpToNote`),children:[d(`span`,{className:`bx bx-search empty-tab-search-mobile-icon`}),d(`span`,{className:`empty-tab-search-mobile-placeholder`,children:l(`empty.search_placeholder`)})]})}function b({ntxId:t}){let n=o(null),i=o(null);return r(()=>{let e=f(i);m.showRecentNotes(e)},[]),d(e,{children:[d(g,{name:`empty-tab-search`,label:l(`empty.open_note_instruction`),className:`empty-tab-search`,children:d(h,{placeholder:l(`empty.search_placeholder`),container:n,inputRef:i,opts:{hideGoToSelectedNoteButton:!0,allowCreatingNotes:!0,allowJumpToSearchNotes:!0},onChange:e=>{if(!e?.notePath)return!1;let n=s.tabManager.getNoteContextById(t)??s.tabManager.getActiveContext();n&&n.setNote(e.notePath)}})}),d(`div`,{ref:n,className:`note-detail-empty-results`})]})}function x(){let[e,t]=a(),n=i(p);function o(){c.searchForNotes(`#workspace #!template`).then(t)}return r(o,[]),d(`div`,{class:`workspace-notes`,children:e?.map(e=>d(`div`,{className:`workspace-note`,title:l(`empty.enter_workspace`,{title:e.title}),onClick:()=>n?.triggerCommand(`hoistNote`,{noteId:e.noteId}),children:[d(`div`,{className:`${e.getIcon()} workspace-icon`}),d(`div`,{children:e.title})]}))})}export{_ as default};