<template>
	<view class="container">
		<view class="chat-ai">
			<ChatMarkdown v-if="text.length > 0" :text="text"></ChatMarkdown>
			<slot name="content"></slot>
		</view>
		<slot name="footer"></slot>
	</view>
</template>

<script setup>
	import { defineProps } from "vue";
	import ChatMarkdown from "./ChatMarkdown.vue";
	
	defineProps({
	  text: {
	    type: String,
	    default: ''
	  }
	})
	
</script>

<style lang="scss" scoped>
	.container {
		display: flex;
		flex-direction: column;
		max-width: 100%;  // ✅ 限制最大宽度
		overflow-x: hidden;  // ✅ 防止横向撑开
		
		.chat-ai {
			margin: 6px 12px;
			padding: 0 12px;
			
			min-width: 80px;
			background: rgba(255,255,255,0.4);
			box-shadow: 2px 2px 10px 0px rgba(0,0,0,0.1);
			border-radius: 4px 20px 20px 20px;
			border: 1px solid;
			border-color: #FFFFFF;
		}
	}
</style>