import { MESSAGE_CUSTOM_TYPE } from '@linktr.ee/messaging-taxonomy' import { LocalMessage } from 'stream-chat' /** Check if a message is a tip based on metadata */ export const isTipMessage = (message: LocalMessage): boolean => { return message.metadata?.custom_type === MESSAGE_CUSTOM_TYPE.TIP } /** Tip pill — the gift-emoji bubble a tip message attaches, with or without accompanying text */ export const TipMessage = ({ message }: { message: LocalMessage }) => { const amountText = message.metadata?.amount_text if (!amountText) return null return (
{amountText} tip!
) }