2022-07-02 22:24:12 +01:00
|
|
|
import React from 'react';
|
2022-07-02 23:27:22 +01:00
|
|
|
import { IconPosition } from './DialogIcon';
|
|
|
|
|
|
|
|
type Callback<T> = ((value: T) => void) | React.Dispatch<React.SetStateAction<T>>;
|
2022-07-02 22:24:12 +01:00
|
|
|
|
|
|
|
interface DialogContextType {
|
2022-07-02 23:27:22 +01:00
|
|
|
setIcon: Callback<React.ReactNode>;
|
|
|
|
setFooter: Callback<React.ReactNode>;
|
|
|
|
setIconPosition: Callback<IconPosition>;
|
2022-07-02 22:24:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const DialogContext = React.createContext<DialogContextType>({
|
2022-07-02 23:27:22 +01:00
|
|
|
setIcon: () => null,
|
|
|
|
setFooter: () => null,
|
|
|
|
setIconPosition: () => null,
|
2022-07-02 22:24:12 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
export default DialogContext;
|