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

export default defineComponent({
	name: "GnIdentity",
	props: {
		title: { type: String, required: true },
		meta: { type: String, default: "" },
		avatar: { type: Object, default: () => ({}) }
	},
	setup(props, { slots }) {
		return () => h("span", { class: "identity" }, [
			slots.avatar?.() || h(GnAvatar, props.avatar),
			h("span", { class: "identity-content" }, [
				h("span", { class: "identity-title" }, slots.title?.() || props.title),
				(props.meta || slots.meta) && h("span", { class: "identity-meta" }, slots.meta?.() || props.meta)
			])
		]);
	}
});
