+
+
+ setQuery(e.target.value)}
+ placeholder={t('cmdk.placeholder', { defaultValue: 'Поиск товаров, контрагентов, документов или страниц…' })}
+ className="flex-1 bg-transparent outline-none text-sm text-slate-900 dark:text-slate-100 placeholder:text-slate-400"
+ />
+ Esc
+
+
+
+ {items.length === 0 ? (
+
+ {debounced.length >= 2 && !search.isLoading
+ ? t('cmdk.empty', { defaultValue: 'Ничего не найдено' })
+ : t('cmdk.hint', { defaultValue: 'Начните вводить, чтобы найти товары, контрагентов, документы или страницы' })}
+
+ ) : (
+ groups.map((g) => (
+
+
+ {g.title}
+
+
+ {g.items.map((it) => {
+ const idx = items.indexOf(it)
+ const isActive = idx === active
+ const Icon = it.icon
+ return (
+ - setActive(idx)}
+ onClick={it.action}
+ className={`px-4 py-2 flex items-center gap-3 cursor-pointer text-sm ${
+ isActive
+ ? 'bg-emerald-50 dark:bg-emerald-900/30 text-slate-900 dark:text-slate-100'
+ : 'text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-800/50'
+ }`}
+ >
+
+
+ {highlight(it.label, debounced)}
+
+ {it.hint && {it.hint}}
+ {isActive && }
+
+ )
+ })}
+
+
+ ))
+ )}
+
+
+
+
+ ↑↓
+ навигация
+ Enter
+ выбрать
+
+ {search.isLoading && Поиск…}
+
+