@engie-group/fluid-design-system-react
Version:
Fluid Design System React
19 lines (13 loc) • 496 B
text/typescript
import React from 'react';
import { NJChatInputProps } from './root/NJChatInputRoot';
type NJChatInputContextType = {
variant: NJChatInputProps['variant'];
};
export const NJChatInputContext = React.createContext<NJChatInputContextType | null>(null);
export const useNJChatInputContext = () => {
const context = React.useContext(NJChatInputContext);
if (context == null) {
throw new Error('NJChatInput components must be wrapped in <NJChatInput.Root />');
}
return context;
};