import { CopyInput } from './form' import { gql, useMutation } from '@apollo/client' import { INVITE_FIELDS } from '../fragments/invites' import styles from '../styles/invites.module.css' export default function Invite ({ invite, active }) { const [revokeInvite] = useMutation( gql` ${INVITE_FIELDS} mutation revokeInvite($id: ID!) { revokeInvite(id: $id) { ...InviteFields } }` ) return (
{invite.gift} sat gift \ {invite.invitees.length} joined{invite.limit ? ` of ${invite.limit}` : ''} {active ? ( <> \ revokeInvite({ variables: { id: invite.id } })} >revoke ) : invite.revoked && ( <> \ revoked )}
) }