import ExclamationTriangleSvg from '@fortawesome/fontawesome-free/svgs/solid/exclamation-triangle.svg'; import * as _ from 'lodash'; import * as React from 'react'; import { Badge, Flex, Txt, ModalProps } from 'rendition'; import { Modal, ScrollableFlex } from '../../styled-components'; import { middleEllipsis } from '../../utils/middle-ellipsis'; import * as prettyBytes from 'pretty-bytes'; import { DriveWithWarnings } from '../../pages/main/Flash'; const DriveStatusWarningModal = ({ done, cancel, isSystem, drivesWithWarnings, }: ModalProps & { isSystem: boolean; drivesWithWarnings: DriveWithWarnings[]; }) => { let warningSubtitle = 'You are about to erase an unusually large drive'; let warningCta = 'Are you sure the selected drive is not a storage drive?'; if (isSystem) { warningSubtitle = "You are about to erase your computer's drives"; warningCta = 'Are you sure you want to flash your system drive?'; } return ( WARNING! {warningSubtitle} {drivesWithWarnings.map((drive, i, array) => ( <> {middleEllipsis(drive.description, 28)}{' '} {drive.size && prettyBytes(drive.size) + ' '} {drive.statuses[0].message} {i !== array.length - 1 ?
: null} ))}
{warningCta}
); }; export default DriveStatusWarningModal;