mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
15 lines
359 B
TypeScript
15 lines
359 B
TypeScript
import { useContext } from 'react';
|
|
import { SnackbarContext } from '../providers/SnackbarProvider';
|
|
|
|
export interface IAlert {
|
|
message: string;
|
|
type: 'success' | 'error' | 'info';
|
|
}
|
|
|
|
interface ISnackBar {
|
|
addAlert: ({ message, type }: IAlert) => void;
|
|
alert: IAlert | null;
|
|
}
|
|
|
|
export const useSnackbar = (): ISnackBar => useContext(SnackbarContext);
|