|
1 | 1 | import { DialogProps, styled } from '@mui/material';
|
2 | 2 | import React, { useRef, useState } from 'react';
|
3 |
| -import { Dialog, IconButton, Paper, Typography } from '../../base'; |
| 3 | +import { Box, Dialog, IconButton, Paper, Typography } from '../../base'; |
4 | 4 | import { ContainedButton, OutlinedButton, TextButton } from '../../base/Button/Button';
|
5 | 5 | import { iconLarge, iconMedium } from '../../constants/iconsSizes';
|
6 | 6 | import { CloseIcon, InfoCircleIcon } from '../../icons';
|
@@ -172,7 +172,7 @@ export const ModalFooter: React.FC<ModalFooterProps> = ({ helpText, children, va
|
172 | 172 | };
|
173 | 173 |
|
174 | 174 | // ModalButtonPrimary
|
175 |
| -export const ModalButtonPrimary: React.FC = styled(ContainedButton)(({ theme }) => ({ |
| 175 | +export const ModalButtonPrimary = styled(ContainedButton)(({ theme }) => ({ |
176 | 176 | backgroundColor: theme.palette.background.brand?.default,
|
177 | 177 | color: theme.palette.text.constant?.white,
|
178 | 178 | '&:hover': {
|
@@ -215,3 +215,31 @@ export const ModalButtonDanger = styled(ContainedButton)(({ theme }) => ({
|
215 | 215 | background: theme.palette.background.error?.hover
|
216 | 216 | }
|
217 | 217 | }));
|
| 218 | + |
| 219 | +const ButtonContainer = styled(Box)(() => ({ |
| 220 | + width: '100%', |
| 221 | + display: 'flex', |
| 222 | + justifyContent: 'end', |
| 223 | + gap: '1rem' |
| 224 | +})); |
| 225 | + |
| 226 | +interface PrimaryActionButtonsProps { |
| 227 | + primaryText: string; |
| 228 | + secondaryText: string; |
| 229 | + primaryButtonProps?: React.ComponentProps<typeof ModalButtonPrimary>; |
| 230 | + secondaryButtonProps?: React.ComponentProps<typeof ModalButtonSecondary>; |
| 231 | +} |
| 232 | + |
| 233 | +export const PrimaryActionButtons: React.FC<PrimaryActionButtonsProps> = ({ |
| 234 | + primaryText, |
| 235 | + secondaryText, |
| 236 | + primaryButtonProps, |
| 237 | + secondaryButtonProps |
| 238 | +}) => { |
| 239 | + return ( |
| 240 | + <ButtonContainer> |
| 241 | + <ModalButtonSecondary {...secondaryButtonProps}>{secondaryText}</ModalButtonSecondary> |
| 242 | + <ModalButtonPrimary {...primaryButtonProps}>{primaryText}</ModalButtonPrimary> |
| 243 | + </ButtonContainer> |
| 244 | + ); |
| 245 | +}; |
0 commit comments