import { CreateLinkEvent } from '@nitrots/nitro-renderer'; import { FC } from 'react'; import { attemptItemPlacement, LocalizeText } from '../../../../api'; import { Button, Column, LayoutGiftTagView, LayoutImage, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../../common'; import { useFurniturePresentWidget, useInventoryFurni } from '../../../../hooks'; export const FurnitureGiftOpeningView: FC<{}> = props => { const { objectId = -1, classId = -1, itemType = null, text = null, isOwnerOfFurniture = false, senderName = null, senderFigure = null, placedItemId = -1, placedItemType = null, placedInRoom = false, imageUrl = null, openPresent = null, onClose = null } = useFurniturePresentWidget(); const { groupItems = [] } = useInventoryFurni(); if(objectId === -1) return null; const place = (itemId: number) => { const groupItem = groupItems.find(group => (group.getItemById(itemId)?.id === itemId)); if(groupItem) attemptItemPlacement(groupItem); onClose(); }; return ( { (placedItemId === -1) &&
{ isOwnerOfFurniture &&
{ senderName && }
}
} { (placedItemId > -1) &&
{ LocalizeText('widget.furni.present.message_opened') } { text }
{ placedInRoom && }
{ (senderName && senderName.length) && }
}
); };