sweet lander

This commit is contained in:
geoffsee
2025-07-08 14:09:55 -04:00
committed by Geoff Seemueller
parent 818e0e672a
commit c26d2467f4
23 changed files with 387 additions and 107 deletions

View File

@@ -0,0 +1,25 @@
import React, { createContext, useContext, useState } from 'react';
type ComponentContextType = {
enabledComponent: string;
setEnabledComponent: (component: string) => void;
};
const ComponentContext = createContext<ComponentContextType>({
enabledComponent: '',
setEnabledComponent: () => {},
});
export const useComponent = () => useContext(ComponentContext);
export const ComponentProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
const [enabledComponent, setEnabledComponent] = useState<string>('');
return (
<ComponentContext.Provider value={{ enabledComponent, setEnabledComponent }}>
{children}
</ComponentContext.Provider>
);
};
export default ComponentContext;