feat: separate Base bubble

Also added a provider to inject local variant and orientation state to child components
This commit is contained in:
Shivam Mishra
2024-11-27 18:32:46 +05:30
parent 93bbcb2976
commit 0ae085ffbb
4 changed files with 73 additions and 49 deletions
@@ -0,0 +1,16 @@
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);
}