feat: make tryIt presets, limits, badges and buttons completely dynamic from JSON configs
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
'use client';
|
||||
|
||||
import React, { createContext, useContext } from 'react';
|
||||
|
||||
export interface EditorContextType {
|
||||
isEditor: boolean;
|
||||
openInspector: (sectionId?: string, tab?: 'content' | 'items' | 'media' | 'settings') => void;
|
||||
openToolModal: () => void;
|
||||
openShowcaseModal: () => void;
|
||||
updateSectionProps: (sectionId: string, newProps: Record<string, any>) => void;
|
||||
availableTools: any[];
|
||||
}
|
||||
|
||||
export const EditorContext = createContext<EditorContextType>({
|
||||
isEditor: false,
|
||||
openInspector: () => {},
|
||||
openToolModal: () => {},
|
||||
openShowcaseModal: () => {},
|
||||
updateSectionProps: () => {},
|
||||
availableTools: [],
|
||||
});
|
||||
|
||||
export const useEditor = () => useContext(EditorContext);
|
||||
Reference in New Issue
Block a user