import { defineComponent, h } from "vue";
import { cx } from "../utils.js";

export default defineComponent({
	name: "GnActivityLog",
	props: {
		items: { type: Array, default: () => [] }
	},
	setup(props, { attrs, slots }) {
		return () => h("div", { ...attrs, class: cx("activity-log", attrs.class) }, props.items.map(item => h("div", {
			class: "activity-log-row"
		}, [
			h("time", { class: "activity-log-time" }, item.time),
			h("span", { class: "activity-log-title" }, slots[item.key]?.({ item }) || item.title),
			slots.actions && h("span", {}, slots.actions({ item }))
		])));
	}
});
