'use client';

import { createGenericContext } from '@websolutespa/bom-mixer-hooks';
import React from 'react';
import { IThemeForm } from '../../theme';

const defaultThemeForm: Partial<IThemeForm> = {
  padding: '60px',
};

const [useThemeForm, ThemeFormContextProvider] = createGenericContext<Partial<IThemeForm>>(defaultThemeForm);

function ThemeFormProvider({ children, options }: { children?: React.ReactNode, options?: Partial<IThemeForm> }) {
  return (
    <ThemeFormContextProvider value={{ ...defaultThemeForm, ...options }}>
      {children}
    </ThemeFormContextProvider>
  );
}

export { useThemeForm, ThemeFormProvider };

