mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-09-27 19:28:57 +03:00
29 lines
633 B
TypeScript
29 lines
633 B
TypeScript
import { createContext } from "react";
|
|||
|
|
|
||
|
|
export type StatusMessage = {
|
||
|
|
id: string;
|
||
|
|
text: string;
|
||
|
|
color?: string;
|
||
|
|
link?: string;
|
||
|
|
};
|
||
|
|
|
||
|
|
export type StatusMessagesState = {
|
||
|
|
[key: string]: StatusMessage[];
|
||
|
|
};
|
||
|
|
|
||
|
|
type StatusBarMessagesContextValue = {
|
||
|
|
messages: StatusMessagesState;
|
||
|
|
addMessage: (
|
||
|
|
key: string,
|
||
|
|
message: string,
|
||
|
|
color?: string,
|
||
|
|
messageId?: string,
|
||
|
|
link?: string,
|
||
|
|
) => string | undefined;
|
||
|
|
removeMessage: (key: string, messageId: string) => void;
|
||
|
|
clearMessages: (key: string) => void;
|
||
|
|
};
|
||
|
|
|
||
|
|
export const StatusBarMessagesContext =
|
||
|
|
createContext<StatusBarMessagesContextValue | null>(null);
|