Files
chatwoot/app/javascript/dashboard/components-next/message/provider.js
T
Shivam Mishra 0ae085ffbb feat: separate Base bubble
Also added a provider to inject local variant and orientation state to child components
2024-11-27 18:32:46 +05:30

17 lines
399 B
JavaScript

import { inject, provide } from 'vue';
const MessageControl = Symbol('MessageControl');
export function useMessageContext() {
const context = inject(MessageControl, null);
if (context === null) {
throw new Error(`Component is missing a parent <Message /> component.`);
}
return { ...context };
}
export function provideMessageContext(context) {
provide(MessageControl, context);
}