import { createContext, useContext } from 'react';
import { FieldActions, SchemaConfig } from '../types/SchemaConfig';

export type { FieldActions, SchemaConfig };

export type SchemaContextValue = {
  schema: SchemaConfig;
  addField?: () => void;
  editField?: (fieldId: string) => void;
};

export const SchemaContext = createContext<SchemaContextValue | null>(null);

export const useSchemaContext = () => useContext(SchemaContext);
