feat(search): use NoItems for not executed & no results

This commit is contained in:
Elian Doran 2026-02-21 18:51:16 +02:00
parent 93e59cc3b6
commit 16ed14f85a
No known key found for this signature in database
2 changed files with 3 additions and 8 deletions

View File

@ -9,8 +9,3 @@
.search-result-widget .note-list {
padding: 10px;
}
.search-no-results, .search-not-executed-yet {
margin: 20px;
padding: 20px !important;
}

View File

@ -5,8 +5,8 @@ import { useEffect, useState } from "preact/hooks";
import { t } from "../services/i18n";
import { SearchNoteList } from "./collections/NoteList";
import Alert from "./react/Alert";
import { useNoteContext, useTriliumEvent } from "./react/hooks";
import NoItems from "./react/NoItems";
enum SearchResultState {
NO_RESULTS,
@ -47,11 +47,11 @@ export default function SearchResult() {
return (
<div className={clsx("search-result-widget", state === undefined && "hidden-ext")}>
{state === SearchResultState.NOT_EXECUTED && (
<Alert type="info" className="search-not-executed-yet">{t("search_result.search_not_executed")}</Alert>
<NoItems icon="bx bx-file-find" text={t("search_result.search_not_executed")} />
)}
{state === SearchResultState.NO_RESULTS && (
<Alert type="info" className="search-no-results">{t("search_result.no_notes_found")}</Alert>
<NoItems icon="bx bx-rectangle" text={t("search_result.no_notes_found")} />
)}
{state === SearchResultState.GOT_RESULTS && (