<template>
  <div class="custom-gpt-dialog">
    <t-dialog
      v-model:visible="visible"
      placement="center"
      :cancelBtn="null"
      :confirmBtn="null"
    >
      <CustomGptMessage :list="list"></CustomGptMessage>
    </t-dialog>
  </div>
</template>

<script lang="ts" setup>
import { Dialog as TDialog } from 'tdesign-vue-next';
import CustomGptMessage from '@/components/custom/gptmessage.vue';
import { ref, watch } from 'vue';
const props = defineProps<{
  modelValue: boolean;
  list: any[];
}>();
const emit = defineEmits(['update:modelValue']);
const visible = ref(props.modelValue);
watch(
  () => props.modelValue,
  (v) => {
    visible.value = v;
  }
);
watch(
  () => visible.value,
  (v) => {
    emit('update:modelValue', v);
  }
);
</script>

<style lang="less">
.custom-gpt-dialog {
  .t-dialog {
    background: #181818;
    border: none;
    .t-dialog__close {
      color: #ddd;
    }
    .message {
      color: white;
    }
  }
}
</style>
