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