import{defineComponent as D,createVNode as n}from"vue";import{flattenChildren as S}from"../_util/props-util/index.mjs";import{withInstall as I}from"../_util/type.mjs";import s from"../_util/vue-types/index.mjs";import j from"../config-provider/hooks/useConfigInject.mjs";import w from"./style/index.mjs";const L=()=>({actions:Array,author:s.any,avatar:s.any,content:s.any,prefixCls:String,datetime:s.any}),N=D({compatConfig:{MODE:3},name:"AComment",inheritAttrs:!1,props:L(),slots:Object,setup(e,{slots:o,attrs:m}){const{prefixCls:l,direction:d}=j("comment",e),[f,v]=w(l),h=(t,a)=>n("div",{class:`${t}-nested`},[a]),p=t=>!t||!t.length?null:t.map((r,c)=>n("li",{key:`action-${c}`},[r]));return()=>{const t=l.value,a=e.actions??o.actions?.(),r=e.author??o.author?.(),c=e.avatar??o.avatar?.(),y=e.content??o.content?.(),u=e.datetime??o.datetime?.(),$=n("div",{class:`${t}-avatar`},[typeof c=="string"?n("img",{src:c,alt:"comment-avatar"},null):c]),C=a?n("ul",{class:`${t}-actions`},[p(Array.isArray(a)?a:[a])]):null,g=n("div",{class:`${t}-content-author`},[r&&n("span",{class:`${t}-content-author-name`},[r]),u&&n("span",{class:`${t}-content-author-time`},[u])]),A=n("div",{class:`${t}-content`},[g,n("div",{class:`${t}-content-detail`},[y]),C]),x=n("div",{class:`${t}-inner`},[$,A]),i=S(o.default?.());return f(n("div",{...m,class:[t,{[`${t}-rtl`]:d.value==="rtl"},m.class,v.value]},[x,i&&i.length?h(t,i):null]))}}}),R=I(N);export{L as commentProps,R as default};
