mirror of
https://github.com/owncast/owncast.git
synced 2024-12-18 07:12:33 +03:00
e50b23d081
* chore(js): be stricter about dead code warnings * chore(js): remove dead code and unused exports * rebase * chore: remove unused files * chore(deps): remove unused prop-types dep * chore(js): remove unused function * chore(deps): remove + check unused deps * chore(js): remove unused exports. Closes #3036
24 lines
593 B
TypeScript
24 lines
593 B
TypeScript
import React, { useState, FC, ReactElement } from 'react';
|
|
|
|
export const AlertMessageContext = React.createContext({
|
|
message: null,
|
|
setMessage: (_text?: string) => null,
|
|
});
|
|
|
|
export type AlertMessageProviderProps = {
|
|
children: ReactElement;
|
|
};
|
|
|
|
const AlertMessageProvider: FC<AlertMessageProviderProps> = ({ children }) => {
|
|
const [message, setMessage] = useState('');
|
|
|
|
const providerValue = {
|
|
message,
|
|
setMessage,
|
|
};
|
|
return (
|
|
<AlertMessageContext.Provider value={providerValue}>{children}</AlertMessageContext.Provider>
|
|
);
|
|
};
|
|
|
|
export default AlertMessageProvider;
|