Skip to content

Commit e9eef79

Browse files
authored
Merge pull request #3915 from Northeastern-Electric-Racing/#3880-add-copy-from-existing-bom-button
#3880 add copy from existing bom button
2 parents 965fb7c + fda946d commit e9eef79

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

src/frontend/src/pages/ProjectDetailPage/ProjectViewContainer/BOM/MaterialForm/MaterialFormView.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
Button,
23
FormControl,
34
FormHelperText,
45
FormLabel,
@@ -39,6 +40,7 @@ export interface MaterialFormViewProps {
3940
watch: UseFormWatch<MaterialFormInput>;
4041
createManufacturer: (name: string) => void;
4142
setValue: UseFormSetValue<MaterialFormInput>;
43+
copyFromExistingBomAction?: React.ReactNode;
4244
}
4345

4446
const manufacturersToAutocomplete = (manufacturer: Manufacturer): { label: string; id: string } => {
@@ -494,6 +496,30 @@ const MaterialFormView: React.FC<MaterialFormViewProps> = ({
494496
</FormControl>
495497
</Box>
496498
</Grid>
499+
{submitText === 'Add' && (
500+
<Grid item xs={12} sx={{ pl: 0, pr: 0 }}>
501+
<Box
502+
sx={{
503+
pt: 1
504+
}}
505+
>
506+
<Button
507+
variant="contained"
508+
disableElevation
509+
onClick={() => {}}
510+
sx={{
511+
mx: 0,
512+
textTransform: 'none',
513+
bgcolor: '#EF4345',
514+
color: (t) => t.palette.getContrastText('#EF4345'),
515+
'&:hover': { bgcolor: (t) => t.palette.error.dark }
516+
}}
517+
>
518+
COPY FROM EXISTING BOM
519+
</Button>
520+
</Box>
521+
</Grid>
522+
)}
497523
</NERFormModal>
498524
);
499525
};

0 commit comments

Comments
 (0)