29 lines
1.2 KiB
TypeScript
29 lines
1.2 KiB
TypeScript
import { Attachment, AttachmentType } from "@/app/providers/ProtocolProvider/protocol/packets/packet.message";
|
|
import { AttachImage } from "./AttachImage";
|
|
import { AttachMessages } from "./AttachMessages";
|
|
import { AttachFile } from "./AttachFile";
|
|
import { AttachAvatar } from "./AttachAvatar";
|
|
|
|
export interface DialogAttachmentProps {
|
|
attach: Attachment;
|
|
onRemove?: (attach: Attachment) => void;
|
|
}
|
|
|
|
export function DialogAttachment(props : DialogAttachmentProps) {
|
|
return (
|
|
<>
|
|
{props.attach.type == AttachmentType.IMAGE &&
|
|
<AttachImage attach={props.attach} onRemove={props.onRemove}></AttachImage>
|
|
}
|
|
{props.attach.type == AttachmentType.MESSAGES &&
|
|
<AttachMessages attach={props.attach} onRemove={props.onRemove}></AttachMessages>
|
|
}
|
|
{props.attach.type == AttachmentType.FILE &&
|
|
<AttachFile attach={props.attach} onRemove={props.onRemove}></AttachFile>
|
|
}
|
|
{props.attach.type == AttachmentType.AVATAR &&
|
|
<AttachAvatar attach={props.attach} onRemove={props.onRemove}></AttachAvatar>
|
|
}
|
|
</>
|
|
)
|
|
} |