feat: updated generic attachment to pass through pending prop

pull/3170/head
yougotwill 9 months ago
parent 1f1f5adb48
commit 45d1791cdf

@ -15,19 +15,21 @@ const StyledGenericAttachmentContainer = styled(MessageHighlighter)<{
export function MessageGenericAttachment({ export function MessageGenericAttachment({
attachment, attachment,
direction, /** comes from the attachment iself or the component if it needs to be decrypted */
highlight, pending,
selected, selected,
highlight,
direction,
onClick, onClick,
}: { }: {
attachment: PropsForAttachment | AttachmentTypeWithPath; attachment: PropsForAttachment | AttachmentTypeWithPath;
highlight: boolean; pending: boolean;
selected: boolean; selected: boolean;
highlight: boolean;
direction?: MessageModelType; direction?: MessageModelType;
onClick?: (e: any) => void; onClick?: (e: any) => void;
}) { }) {
// TODO add higher level pending or loading states const { fileName, fileSize, contentType } = attachment;
const { pending, fileName, fileSize, contentType } = attachment;
const extension = getExtensionForDisplay({ contentType, fileName }); const extension = getExtensionForDisplay({ contentType, fileName });
return ( return (

@ -156,7 +156,7 @@ export function isVideoAttachment(attachment?: AttachmentType): boolean {
export function hasVideoScreenshot(attachments?: Array<AttachmentType>): boolean { export function hasVideoScreenshot(attachments?: Array<AttachmentType>): boolean {
const firstAttachment = attachments ? attachments[0] : null; const firstAttachment = attachments ? attachments[0] : null;
return Boolean(firstAttachment?.screenshot?.url); return Boolean(firstAttachment?.screenshot?.url || firstAttachment?.pending);
} }
type DimensionsType = { type DimensionsType = {

Loading…
Cancel
Save