import React from 'react'; import axios from 'axios'; import { CustomerClient, CustomerListItem } from '../../APIClient'; import { Layout } from '../shared/Layout'; import Swal from 'sweetalert2'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faTrash } from '@fortawesome/free-solid-svg-icons'; const DeleteCustomerButton: React.FunctionComponent<{ customerID: string, onDelete: (val) => void }> = ({ customerID, onDelete }) => { const onClickDelete = async () => { const result = await Swal.fire({ title: 'Confirm delete?', text: 'Delete customer?', icon: 'warning', showCancelButton: true, }) if (result.isConfirmed) { onDelete(customerID); } } return ( ); } const CustomerListItemRows: React.FunctionComponent<{ customers: CustomerListItem[], onDelete: (val) => void, }> = ({ customers, onDelete }) => { let rows = customers.map(x => { return (
ID | Name |
---|