import style_default from "./style/index.js";
import { computed, createVNode, defineComponent, mergeProps, useAttrs } from "vue";
import { Tooltip } from "antdv-next";
import { DislikeFilled, DislikeOutlined, LikeFilled, LikeOutlined } from "@antdv-next/icons";
//#region components/actions/ActionsFeedback.tsx
var FEEDBACK_VALUE = /* @__PURE__ */ function(FEEDBACK_VALUE) {
	FEEDBACK_VALUE["like"] = "like";
	FEEDBACK_VALUE["dislike"] = "dislike";
	FEEDBACK_VALUE["default"] = "default";
	return FEEDBACK_VALUE;
}(FEEDBACK_VALUE || {});
var XActionsFeedback = /* @__PURE__ */ defineComponent({
	name: "AxActionsFeedback",
	inheritAttrs: false,
	props: {
		value: {
			type: String,
			default: FEEDBACK_VALUE.default
		},
		onChange: {
			type: Function,
			default: void 0
		},
		prefixCls: {
			type: String,
			default: "antd-actions"
		},
		rootClass: {
			type: String,
			default: ""
		},
		class: {
			type: [
				String,
				Array,
				Object
			],
			default: void 0
		},
		style: {
			type: [
				String,
				Object,
				Array
			],
			default: void 0
		},
		classes: {
			type: Object,
			default: () => ({})
		},
		styles: {
			type: Object,
			default: () => ({})
		}
	},
	setup(props) {
		const attrs = useAttrs();
		const [hashId, cssVarCls] = style_default(computed(() => props.prefixCls));
		const feedbackCls = `${props.prefixCls}-feedback`;
		const domAttrs = computed(() => {
			const { class: _class, style: _style, ...rest } = attrs;
			return rest;
		});
		const onDislikeClick = () => {
			props.onChange?.(props.value === FEEDBACK_VALUE.dislike ? FEEDBACK_VALUE.default : FEEDBACK_VALUE.dislike);
		};
		return () => createVNode("div", mergeProps(domAttrs.value, {
			"class": [
				props.prefixCls,
				feedbackCls,
				hashId.value,
				cssVarCls.value,
				props.rootClass,
				props.classes?.root,
				`${props.prefixCls}-list`,
				attrs.class,
				props.class
			],
			"style": [
				props.styles?.root,
				attrs.style,
				props.style
			]
		}), [[FEEDBACK_VALUE.default, FEEDBACK_VALUE.like].includes(props.value) && createVNode(Tooltip, {
			"key": `like_${props.value}`,
			"title": "Like"
		}, { default: () => [createVNode("span", {
			"onClick": () => props.onChange?.(props.value === FEEDBACK_VALUE.like ? FEEDBACK_VALUE.default : FEEDBACK_VALUE.like),
			"style": [props.styles?.like, props.value === FEEDBACK_VALUE.like ? props.styles?.liked : void 0],
			"class": [
				`${feedbackCls}-item`,
				`${props.prefixCls}-item`,
				`${feedbackCls}-item-like`,
				props.classes?.like,
				props.value === FEEDBACK_VALUE.like ? props.classes?.liked : void 0,
				{ [`${feedbackCls}-item-like-active`]: props.value === FEEDBACK_VALUE.like }
			]
		}, [props.value === FEEDBACK_VALUE.like ? createVNode(LikeFilled, null, null) : createVNode(LikeOutlined, null, null)])] }), [FEEDBACK_VALUE.default, FEEDBACK_VALUE.dislike].includes(props.value) && createVNode(Tooltip, {
			"key": `dislike_${props.value}`,
			"title": "Dislike"
		}, { default: () => [createVNode("span", {
			"onClick": onDislikeClick,
			"style": [props.styles?.dislike, props.value === FEEDBACK_VALUE.dislike ? props.styles?.disliked : void 0],
			"class": [
				`${feedbackCls}-item`,
				`${props.prefixCls}-item`,
				`${feedbackCls}-item-dislike`,
				props.classes?.dislike,
				props.value === FEEDBACK_VALUE.dislike ? props.classes?.disliked : void 0,
				{ [`${feedbackCls}-item-dislike-active`]: props.value === FEEDBACK_VALUE.dislike }
			]
		}, [props.value === FEEDBACK_VALUE.dislike ? createVNode(DislikeFilled, null, null) : createVNode(DislikeOutlined, null, null)])] })]);
	}
});
//#endregion
export { XActionsFeedback, XActionsFeedback as default };
