mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-10 07:25:35 +00:00
feat: add a search modal using the database (wip)
This commit is contained in:
31
inertia/types/search.d.ts
vendored
31
inertia/types/search.d.ts
vendored
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user