UNPKG

leumas-private-shared

Version:

Private React JSX Package For Leumas Shared Components, Headers, Footers, Asides, Login Pages, API Key Manager and much more. Styles and everything reusable to avoid DRY code across all of our subdomains

29 lines (24 loc) 1.13 kB
import React, { useState } from 'react'; import SchemaSelector from './SchemaSelector'; import GetAllByOwner from "../UniversalCrud/GetAllByOwner" import {useAuthUser} from "react-auth-kit" import AICard from "../../../components/Cards/AICard" const Creator = ({setMode}) => { const [selectedSchema, setSelectedSchema] = useState(''); // State to keep track of selected schema in parent const auth = useAuthUser(); // Function to handle schema selection const handleSchemaSelect = (schema) => { setSelectedSchema(schema); // Now you can use 'selectedSchema' in your Creator component // For demonstration: console.log(`Schema selected in parent: ${schema}`); }; return ( <div> {/* <SchemaSelector onSchemaSelect={handleSchemaSelect} /> */} {/* You can use 'selectedSchema' here if needed */} <GetAllByOwner setMode={setMode} model={selectedSchema} handleSchemaSelect={handleSchemaSelect} token={auth()?.token} endpoint="LeumasAPI" id={auth()?.id} /> </div> ); }; export default Creator;