feat(chat-room) AI 메시지에 이미지를 표시할 수 있도록 수정
This commit is contained in:
		@@ -87,18 +87,36 @@ struct AiMessageItemView: View {
 | 
				
			|||||||
                            .foregroundColor(.white)
 | 
					                            .foregroundColor(.white)
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    
 | 
					                    
 | 
				
			||||||
                    // 메시지 버블
 | 
					                    // 메시지 내용 (텍스트 또는 이미지)
 | 
				
			||||||
                    HStack(spacing: 10) {
 | 
					                    if message.messageType.lowercased() == "image", let imageUrl = message.imageUrl, !imageUrl.isEmpty {
 | 
				
			||||||
                        styledMessageText(message.message)
 | 
					                        // 이미지 메시지
 | 
				
			||||||
                            .lineLimit(nil)
 | 
					                        let maxWidth = (UIScreen.main.bounds.width - 48) * 0.7
 | 
				
			||||||
                            .multilineTextAlignment(.leading)
 | 
					                        let imageHeight = maxWidth * 5 / 4 // 4:5 비율
 | 
				
			||||||
 | 
					                        
 | 
				
			||||||
 | 
					                        KFImage(URL(string: imageUrl))
 | 
				
			||||||
 | 
					                            .placeholder {
 | 
				
			||||||
 | 
					                                Rectangle()
 | 
				
			||||||
 | 
					                                    .fill(Color.gray.opacity(0.3))
 | 
				
			||||||
 | 
					                                    .frame(width: maxWidth, height: imageHeight)
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                            .resizable()
 | 
				
			||||||
 | 
					                            .aspectRatio(4/5, contentMode: .fit)
 | 
				
			||||||
 | 
					                            .frame(width: maxWidth, height: imageHeight)
 | 
				
			||||||
 | 
					                            .cornerRadius(10)
 | 
				
			||||||
 | 
					                    } else {
 | 
				
			||||||
 | 
					                        // 텍스트 메시지 버블
 | 
				
			||||||
 | 
					                        HStack(spacing: 10) {
 | 
				
			||||||
 | 
					                            styledMessageText(message.message)
 | 
				
			||||||
 | 
					                                .lineLimit(nil)
 | 
				
			||||||
 | 
					                                .multilineTextAlignment(.leading)
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                        .padding(.horizontal, 10)
 | 
				
			||||||
 | 
					                        .padding(.vertical, 8)
 | 
				
			||||||
 | 
					                        .background(
 | 
				
			||||||
 | 
					                            Color.black.opacity(0.1)
 | 
				
			||||||
 | 
					                        )
 | 
				
			||||||
 | 
					                        .clipShape(AiMessageBubbleShape())
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    .padding(.horizontal, 10)
 | 
					 | 
				
			||||||
                    .padding(.vertical, 8)
 | 
					 | 
				
			||||||
                    .background(
 | 
					 | 
				
			||||||
                        Color.black.opacity(0.1)
 | 
					 | 
				
			||||||
                    )
 | 
					 | 
				
			||||||
                    .clipShape(AiMessageBubbleShape())
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
@@ -165,12 +183,12 @@ struct AiMessageItemView: View {
 | 
				
			|||||||
    AiMessageItemView(
 | 
					    AiMessageItemView(
 | 
				
			||||||
        message: ServerChatMessage(
 | 
					        message: ServerChatMessage(
 | 
				
			||||||
            messageId: 1,
 | 
					            messageId: 1,
 | 
				
			||||||
            message: "(언제부턴가) 너랑 노는게 제일 재밌고\n너랑 이야기 하는게 제일 신나더라,\n앞으로도 그럴 것 같아❤️",
 | 
					            message: "",
 | 
				
			||||||
            profileImageUrl: "https://example.com/profile.jpg",
 | 
					            profileImageUrl: "https://example.com/profile.jpg",
 | 
				
			||||||
            mine: false,
 | 
					            mine: false,
 | 
				
			||||||
            createdAt: Date().currentTimeMillis(),
 | 
					            createdAt: Date().currentTimeMillis(),
 | 
				
			||||||
            messageType: "text",
 | 
					            messageType: "IMAGE",
 | 
				
			||||||
            imageUrl: nil,
 | 
					            imageUrl: "https://picsum.photos/1000",
 | 
				
			||||||
            price: nil,
 | 
					            price: nil,
 | 
				
			||||||
            hasAccess: true
 | 
					            hasAccess: true
 | 
				
			||||||
        ),
 | 
					        ),
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user