import React from 'react' import FormFooter from '../Form/FormFooter' import PopoverHeader from '../PopoverHeader/PopoverHeader' import styles from './_confirmation-popover.module.scss' import { type ConfirmationItem } from '../Button/ButtonComponents/ConfirmationButton' import { type IconStringList } from '../Icons/Icon.models' import { c } from '../../translations/LibraryTranslationService' export type ConfirmationPopoverContentProps = Pick< ConfirmationItem, | 'type' | 'confirmCallout' | 'header' | 'body' | 'confirmButtonText' | 'cancelButtonText' | 'cancelCallout' > & { /** Optional prop to add a test id to the ConfirmationPopoverContent for QA testing */ qaTestId?: string } const ConfirmationPopoverContent = ({ type, header, body, cancelCallout, confirmCallout, confirmButtonText, cancelButtonText, qaTestId = 'confirmation-popover-content', }: ConfirmationPopoverContentProps): React.JSX.Element => { let icon: IconStringList = 'check' let buttonColor: | 'primary' | 'primary-red' | 'primary-green' | 'primary-blue' = 'primary-blue' switch (type) { case 'red': icon = 'flag' buttonColor = 'primary-red' break case 'blue': icon = 'info' buttonColor = 'primary-blue' break case 'green': icon = 'check' buttonColor = 'primary-green' break case 'black': buttonColor = 'primary' break default: break } return (