import { defineComponent, inject } from 'vue'; import PropsTypes from '../_util/vue-types'; import { getComponent, getSlot } from '../_util/props-util'; import { defaultConfigProvider } from '../config-provider'; import { VueNode, withInstall } from '../_util/type'; export const CommentProps = { actions: PropsTypes.array, /** The element to display as the comment author. */ author: PropsTypes.VNodeChild, /** The element to display as the comment avatar - generally an antd Avatar */ avatar: PropsTypes.VNodeChild, /** The main content of the comment */ content: PropsTypes.VNodeChild, /** Comment prefix defaults to '.ant-comment' */ prefixCls: PropsTypes.string, /** A datetime element containing the time to be displayed */ datetime: PropsTypes.VNodeChild, }; const Comment = defineComponent({ name: 'AComment', props: CommentProps, setup() { return { configProvider: inject('configProvider', defaultConfigProvider), }; }, methods: { getAction(actions: VueNode[]) { if (!actions || !actions.length) { return null; } const actionList = actions.map((action, index) =>