feat: add a search modal using the database (wip)

This commit is contained in:
Sonny
2024-05-25 03:40:08 +02:00
committed by Sonny
parent b28499a69a
commit 56c05f1bf6
21 changed files with 535 additions and 621 deletions

View File

@@ -1,17 +1,18 @@
import type Link from '#models/link';
export interface SearchItem {
id: string;
name: string;
url: string;
type: 'collection' | 'link';
collection?: undefined | Link['collection'];
}
export interface SearchResult {
id: string;
name: React.ReactNode; // React node to support bold text
url: string;
type: 'collection' | 'link';
collection?: undefined | Link['collection'];
}
export type SearchResult =
| {
id: string;
type: 'collection';
name: string;
matched_part?: string;
rank?: number;
}
| {
id: string;
type: 'link';
name: string;
matched_part?: string;
rank?: number;
collection_id: number;
};