avatar url
deploy to danak / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-07-17 20:20:12 +03:30
parent f61a1db4a7
commit b10106fd95
21 changed files with 244 additions and 81 deletions
+11 -5
View File
@@ -4,11 +4,18 @@ import { clx } from "@/helpers/utils";
import { t } from "@/locale";
import type { TicketThreadItemType } from "./types/TicketTypes";
import { formatDate } from "./detailUtils";
import { getPresignedUrl } from "@/pages/uploader/service/UploaderService";
export type MessageBubbleProps = { item: TicketThreadItemType };
const MessageBubble: FC<MessageBubbleProps> = ({ item }) => {
const isUser = item.isFromUser;
const handleOpenLink = async (key: string) => {
const url = await getPresignedUrl(key);
window.open(url, "_blank", "noopener,noreferrer");
};
return (
<div
className={clx(
@@ -30,16 +37,15 @@ const MessageBubble: FC<MessageBubbleProps> = ({ item }) => {
{item.attachments && item.attachments.length > 0 && (
<div className="flex gap-2 flex-wrap text-sm mt-2">
{item.attachments.map((att, index) => (
<a
<button
key={att.id}
href={att.attachmentUrl}
target="_blank"
rel="noreferrer"
type="button"
onClick={() => handleOpenLink(att.attachmentUrl)}
className="text-[#0047FF] flex gap-1 items-center"
>
<Paperclip2 size={20} color="#0047FF" />
{t("attach")} {index + 1}
</a>
</button>
))}
</div>
)}