diff --git a/src/components/Dashboard/Inventory/FilamentStocks/NewFilamentStock.jsx b/src/components/Dashboard/Inventory/FilamentStocks/NewFilamentStock.jsx index 838cd9a..3524160 100644 --- a/src/components/Dashboard/Inventory/FilamentStocks/NewFilamentStock.jsx +++ b/src/components/Dashboard/Inventory/FilamentStocks/NewFilamentStock.jsx @@ -1,18 +1,9 @@ import PropTypes from 'prop-types' -import { useState } from 'react' -import { useMediaQuery } from 'react-responsive' -import { Typography, Flex, Steps, Divider } from 'antd' - import ObjectInfo from '../../common/ObjectInfo' import NewObjectForm from '../../common/NewObjectForm' -import NewObjectButtons from '../../common/NewObjectButtons' - -const { Title } = Typography +import WizardView from '../../common/WizardView' const NewFilamentStock = ({ onOk, reset }) => { - const [currentStep, setCurrentStep] = useState(0) - const isMobile = useMediaQuery({ maxWidth: 768 }) - return ( { column={1} bordered={false} isEditing={true} - initial={true} required={true} objectData={objectData} /> @@ -56,43 +46,16 @@ const NewFilamentStock = ({ onOk, reset }) => { } ] return ( - - {!isMobile && ( -
- -
- )} - - {!isMobile && ( - - )} - - - - New Filament Stock - -
- {steps[currentStep].content} -
- setCurrentStep((prev) => prev - 1)} - onNext={() => setCurrentStep((prev) => prev + 1)} - onSubmit={() => { - handleSubmit() - onOk() - }} - formValid={formValid} - submitLoading={submitLoading} - /> -
-
+ { + handleSubmit() + onOk() + }} + /> ) }}
diff --git a/src/components/Dashboard/Inventory/PartStocks/NewPartStock.jsx b/src/components/Dashboard/Inventory/PartStocks/NewPartStock.jsx index 41c244f..69b2dd4 100644 --- a/src/components/Dashboard/Inventory/PartStocks/NewPartStock.jsx +++ b/src/components/Dashboard/Inventory/PartStocks/NewPartStock.jsx @@ -1,18 +1,9 @@ import PropTypes from 'prop-types' -import { useState } from 'react' -import { useMediaQuery } from 'react-responsive' -import { Typography, Flex, Steps, Divider } from 'antd' - import ObjectInfo from '../../common/ObjectInfo' import NewObjectForm from '../../common/NewObjectForm' -import NewObjectButtons from '../../common/NewObjectButtons' - -const { Title } = Typography +import WizardView from '../../common/WizardView' const NewPartStock = ({ onOk, reset }) => { - const [currentStep, setCurrentStep] = useState(0) - const isMobile = useMediaQuery({ maxWidth: 768 }) - return ( { column={1} bordered={false} isEditing={true} - initial={true} required={true} objectData={objectData} /> @@ -56,43 +46,16 @@ const NewPartStock = ({ onOk, reset }) => { } ] return ( - - {!isMobile && ( -
- -
- )} - - {!isMobile && ( - - )} - - - - New Part Stock - -
- {steps[currentStep].content} -
- setCurrentStep((prev) => prev - 1)} - onNext={() => setCurrentStep((prev) => prev + 1)} - onSubmit={() => { - handleSubmit() - onOk() - }} - formValid={formValid} - submitLoading={submitLoading} - /> -
-
+ { + handleSubmit() + onOk() + }} + /> ) }}
diff --git a/src/components/Dashboard/Inventory/StockAudits/NewStockAudit.jsx b/src/components/Dashboard/Inventory/StockAudits/NewStockAudit.jsx index d18dc9d..9422e8c 100644 --- a/src/components/Dashboard/Inventory/StockAudits/NewStockAudit.jsx +++ b/src/components/Dashboard/Inventory/StockAudits/NewStockAudit.jsx @@ -1,18 +1,9 @@ import PropTypes from 'prop-types' -import { useState } from 'react' -import { useMediaQuery } from 'react-responsive' -import { Typography, Flex, Steps, Divider } from 'antd' - import ObjectInfo from '../../common/ObjectInfo' import NewObjectForm from '../../common/NewObjectForm' -import NewObjectButtons from '../../common/NewObjectButtons' - -const { Title } = Typography +import WizardView from '../../common/WizardView' const NewStockAudit = ({ onOk, reset }) => { - const [currentStep, setCurrentStep] = useState(0) - const isMobile = useMediaQuery({ maxWidth: 768 }) - return ( { column={1} bordered={false} isEditing={true} - initial={true} required={true} objectData={objectData} /> @@ -56,43 +46,16 @@ const NewStockAudit = ({ onOk, reset }) => { } ] return ( - - {!isMobile && ( -
- -
- )} - - {!isMobile && ( - - )} - - - - New Stock audit - -
- {steps[currentStep].content} -
- setCurrentStep((prev) => prev - 1)} - onNext={() => setCurrentStep((prev) => prev + 1)} - onSubmit={() => { - handleSubmit() - onOk() - }} - formValid={formValid} - submitLoading={submitLoading} - /> -
-
+ { + handleSubmit() + onOk() + }} + /> ) }}
diff --git a/src/components/Dashboard/Management/DocumentSizes/NewDocumentSize.jsx b/src/components/Dashboard/Management/DocumentSizes/NewDocumentSize.jsx index 51a0c68..972bf97 100644 --- a/src/components/Dashboard/Management/DocumentSizes/NewDocumentSize.jsx +++ b/src/components/Dashboard/Management/DocumentSizes/NewDocumentSize.jsx @@ -1,19 +1,9 @@ import PropTypes from 'prop-types' -import { useState } from 'react' -import { useMediaQuery } from 'react-responsive' -import { Typography, Flex, Steps, Divider } from 'antd' - import ObjectInfo from '../../common/ObjectInfo' import NewObjectForm from '../../common/NewObjectForm' -import NewObjectButtons from '../../common/NewObjectButtons' - -const { Title } = Typography +import WizardView from '../../common/WizardView' const NewDocumentSize = ({ onOk }) => { - const [currentStep, setCurrentStep] = useState(0) - - const isMobile = useMediaQuery({ maxWidth: 768 }) - return ( {({ handleSubmit, submitLoading, objectData, formValid }) => { @@ -52,43 +42,16 @@ const NewDocumentSize = ({ onOk }) => { } ] return ( - - {!isMobile && ( -
- -
- )} - - {!isMobile && ( - - )} - - - - New Document Size - -
- {steps[currentStep].content} -
- setCurrentStep((prev) => prev - 1)} - onNext={() => setCurrentStep((prev) => prev + 1)} - onSubmit={() => { - handleSubmit() - onOk() - }} - formValid={formValid} - submitLoading={submitLoading} - /> -
-
+ { + handleSubmit() + onOk() + }} + /> ) }}