import {HeartIcon} from '@heroicons/react/24/outline' import clsx from 'clsx' import {useState} from 'react' import {baseButtonClasses} from 'web/components/buttons/button' import {Col} from 'web/components/layout/col' import {Tooltip} from 'web/components/widgets/tooltip' import {api} from 'web/lib/api' import {track} from 'web/lib/service/analytics' export const ShipButton = (props: { targetId1: string targetId2: string shipped: boolean refresh: () => Promise className?: string }) => { const {targetId1, targetId2, shipped, refresh, className} = props const [isLoading, setIsLoading] = useState(false) const like = async () => { setIsLoading(true) await api('ship-profiles', { targetUserId1: targetId1, targetUserId2: targetId2, remove: shipped, }) track('ship profiles', { targetId1, targetId2, remove: shipped, }) await refresh() setIsLoading(false) } return ( ) }