Skip to content

Commit

Permalink
Added props to ErrorDialog and removed unecessary type
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro-Vega committed Nov 29, 2023
1 parent 964e993 commit fe1fa4a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/content/dataSubmissions/ErrorDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,10 @@ const StyledErrorDetails = styled(Stack)({
padding: "10px",
});

type ErrorMessage = { // TODO: REMOVE
title: string;
description: string;
};

type Props = {
header?: string;
title?: string;
closeText?: string;
errors: ErrorMessage[];
uploadedDate: string;
onClose?: () => void;
Expand All @@ -112,6 +108,7 @@ type Props = {
const ErrorDialog = ({
header,
title,
closeText = "Close",
errors,
uploadedDate,
onClose,
Expand All @@ -130,10 +127,10 @@ const ErrorDialog = ({
<CloseIconSvg />
</StyledCloseDialogButton>
<StyledHeader variant="h3">
Data Submission
{header}
</StyledHeader>
<StyledTitle variant="h6">
Error Count
{title}
</StyledTitle>
<StyledErrorDetails direction="column" spacing={2.5}>
<StyledSubtitle variant="body2">
Expand All @@ -148,8 +145,8 @@ const ErrorDialog = ({
))}
</Stack>
</StyledErrorDetails>
<StyledCloseButton id="api-token-close-button" variant="outlined" onClick={handleCloseDialog}>
Close
<StyledCloseButton id="error-dialog-close-button" variant="outlined" onClick={handleCloseDialog}>
{closeText}
</StyledCloseButton>
</StyledDialog>
);
Expand Down

0 comments on commit fe1fa4a

Please sign in to comment.