mirror of
https://github.com/BlowaterNostr/blowater.git
synced 2024-10-18 15:43:20 +00:00
35 lines
732 B
TypeScript
35 lines
732 B
TypeScript
import { PublicKey } from "../lib/nostr-ts/key.ts";
|
|
import { ProfileData } from "../features/profile.ts";
|
|
|
|
export type SearchUpdate = Cancel | SearchPublicKey | SelectProfile | Start;
|
|
export type Start = {
|
|
type: "StartSearch";
|
|
};
|
|
export type Cancel = {
|
|
type: "CancelPopOver";
|
|
};
|
|
export type SearchPublicKey = {
|
|
type: "Search";
|
|
text: string;
|
|
};
|
|
|
|
export type SelectProfile = {
|
|
type: "SelectProfile";
|
|
pubkey: PublicKey;
|
|
};
|
|
|
|
export type SearchModel = {
|
|
isSearching: boolean;
|
|
searchResults: {
|
|
pubkey: PublicKey;
|
|
profile: ProfileData | undefined;
|
|
}[];
|
|
};
|
|
|
|
export const SearchInitModel = (): SearchModel => {
|
|
return {
|
|
searchResults: [],
|
|
isSearching: false,
|
|
};
|
|
};
|