// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { I18n } from '@aws-amplify/core'; import Modal from 'react-bootstrap/Modal'; import Button from 'react-bootstrap/Button'; interface IDeleteConfirmProps { id: string; name: string; delete: (id: string, index: number) => void; showModal: React.Dispatch>; show: boolean; index: number; } export default function DeleteConfirm(props: IDeleteConfirmProps): JSX.Element { /** * Deletes the provided item * @param id - the id of the item to delete * @param index - the index of the item to delete */ const deleteItem = (id: string, index: number) => { props.delete(id, index); props.showModal(false); } return ( { props.showModal(false) }}> {I18n.get('confirm.delete.title')} {I18n.get('confirm.delete.message')} "{props.name}"? ) }