<wxs src="../common/utils.wxs" module="_" />

<view class="class {{classPrefix}}" style="{{_._style([style, customStyle])}}">
  <block wx:if="{{status === 'error' || content.type === 'text'}}">
    <view class="{{classPrefix}}__{{role}} {{classPrefix}}__{{status}}">
      <view class="_pre">
        <rich-text nodes="{{textInfo}}" />
      </view>
    </view>
  </block>
  <block wx:else>
    <view class="{{classPrefix}}__assistant">
      <t-chat-markdown
        content="{{textInfo}}"
        options="{{markdownProps && markdownProps.options}}"
        streaming="{{markdownProps && markdownProps.streaming}}"
        generic:tail-component="tail-component"
        bindclick="onMarkdownClick"
      ></t-chat-markdown>
    </view>
  </block>
</view>
