11import {
2+ Button ,
23 FormControl ,
34 FormHelperText ,
45 FormLabel ,
@@ -22,6 +23,7 @@ import { displayEnum } from '../../../../../utils/pipes';
2223import { MaterialStatus } from 'shared' ;
2324import React from 'react' ;
2425import { AddCircle } from '@mui/icons-material' ;
26+ import BOMCopyConfirmModal from './BOMCopyConfirmModal' ;
2527
2628export interface MaterialFormViewProps {
2729 submitText : 'Add' | 'Edit' ;
@@ -70,6 +72,7 @@ const MaterialFormView: React.FC<MaterialFormViewProps> = ({
7072 const quantity = watch ( 'quantity' ) ;
7173 const price = watch ( 'price' ) ;
7274 const subtotal = quantity && price ? quantity * price : 0 ;
75+ const [ bomConfirmOpen , setBomConfirmOpen ] = React . useState ( false ) ;
7376
7477 return (
7578 < NERFormModal
@@ -477,7 +480,7 @@ const MaterialFormView: React.FC<MaterialFormViewProps> = ({
477480 </ FormControl >
478481 </ Box >
479482 </ Grid >
480- { /* submitText === 'Add' && (
483+ { submitText === 'Add' && (
481484 < Grid item xs = { 12 } sx = { { pl : 0 , pr : 0 } } >
482485 < Box
483486 sx = { {
@@ -487,9 +490,12 @@ const MaterialFormView: React.FC<MaterialFormViewProps> = ({
487490 < Button
488491 variant = "contained"
489492 disableElevation
490- onClick={() => {}}
493+ onClick = { ( ) => {
494+ setBomConfirmOpen ( true ) ;
495+ } }
491496 sx = { {
492497 mx : 0 ,
498+ my : 1 ,
493499 textTransform : 'none' ,
494500 bgcolor : '#EF4345' ,
495501 color : ( t ) => t . palette . getContrastText ( '#EF4345' ) ,
@@ -500,7 +506,14 @@ const MaterialFormView: React.FC<MaterialFormViewProps> = ({
500506 </ Button >
501507 </ Box >
502508 </ Grid >
503- )*/ }
509+ ) }
510+ < BOMCopyConfirmModal
511+ open = { bomConfirmOpen }
512+ onHide = { ( ) => {
513+ setBomConfirmOpen ( false ) ;
514+ } }
515+ onSuccess = { ( ) => { } }
516+ > </ BOMCopyConfirmModal >
504517 </ NERFormModal >
505518 ) ;
506519} ;
0 commit comments