import { useEffect } from 'react' import { useDispatch } from 'react-redux' import InputText from '../../../components/Input/InputText' import Title from '../../../components/Typography/Title' import Subtitle from '../../../components/Typography/Subtitle' import ErrorText from '../../../components/Typography/ErrorText' import HelperText from '../../../components/Typography/HelperText' import { setPageTitle, showNotification } from '../../common/headerSlice' import TitleCard from '../../../components/Cards/TitleCard' function DocComponentsContent(){ const dispatch = useDispatch() const updateFormValue = () => { // Dummy function for input text component } return( <>

Components

We have added some global components that are used commonly inside the project. {/* Typography*/}

Typography

These components are present under /components/Typography folder. It accepts styleClass as props which can be used to pass additional className for style. It has following components which you can import and use it -
{'import  Title from "../components/Typography/Title"\n  Your Title here'}
{/* Form Input*/}

Form Input

Many times we have to use form input like text, select one or toogle and in every file we have to handle its state management, here we have added global form component that can be used in any file and state variables can be managed by passing props to it. It is present in /components/Input folder.

Ex-
{'const INITIAL_LEAD_OBJ = {\n   first_name : "", \n   last_name : "", \n   email : "" \n  } \n   const [leadObj, setLeadObj] = useState(INITIAL_LEAD_OBJ) \n   const updateFormValue = ({updateType, value}) => {\n    setErrorMessage("") \n    setLeadObj({...leadObj, [updateType] : value})\n   }\n\n'}

This example is from add new lead modal, here we are importing component for creating text input and passing some props to handle its content and state variable. Description of props are as follows -

{/* Cards */}

Cards

Daisy UI already have many cards layout, on top of that we have added one card component that accept title props and shows children inside its body. Also there is a divider between title and body of card. On more provision has been added to add buttons on top left side of card using TopSideButtons props (check leads page).

Ex -
{' 

Card Body

'}

Card Body

) } export default DocComponentsContent