import { callAPI } from '../utils/api' import { formatPrice, timePassedSinceTimestamp } from './humanize' import { capitalize, getAvatarOfFallback } from '../utils/misc' import React from 'react' const deletePurchase = id => callAPI(null, { url: `/api/purchases/${id}`, method: 'delete', }).then(() => location.reload()).catch(() => alert('There was a problem deleting the purchase')) const Purchase = ({ purchase, me }) =>