import * as React from 'react'; import { ShareInvitation } from '@joplin/lib/services/share/reducer'; import invitationRespond from '@joplin/lib/services/share/invitationRespond'; import { Button, Card, Icon, Text } from 'react-native-paper'; import { _ } from '@joplin/lib/locale'; import { useCallback } from 'react'; import { ViewStyle } from 'react-native'; interface Props { invitation: ShareInvitation; processing: boolean; containerStyle: ViewStyle; } const ShareIcon = (props: { size: number }) => ; const IncomingShareItem: React.FC = props => { const invitation = props.invitation; const onAcceptInvitation = useCallback(() => { void invitationRespond(invitation.id, invitation.share.folder_id, invitation.master_key, true); }, [invitation]); const onRejectInvitation = useCallback(() => { void invitationRespond(invitation.id, invitation.share.folder_id, invitation.master_key, false); }, [invitation]); const sharer = invitation.share.user; if (!sharer) return Error: Share missing user; // Should not happen return ; }; export default IncomingShareItem;