@scalar/api-client
Version:
the open source API testing client
57 lines (56 loc) • 1.83 kB
JavaScript
import { defineComponent as m, computed as k, createBlock as d, openBlock as S, unref as o, withCtx as t, createVNode as r, createTextVNode as i } from "vue";
import { ScalarMenu as f, ScalarMenuSection as w, ScalarMenuWorkspacePicker as M, ScalarMenuLink as C, ScalarMenuResources as V, ScalarMenuSupport as v } from "@scalar/components";
import { ScalarIconGear as W } from "@scalar/icons";
import { RouterLink as x } from "vue-router";
const L = /* @__PURE__ */ m({
__name: "SidebarMenu",
props: {
activeWorkspace: {},
workspaces: {}
},
emits: ["create:workspace", "select:workspace"],
setup(l, { emit: p }) {
const n = p, c = k(
() => l.workspaces.map((a) => ({
label: a.name,
id: a.id
}))
);
return (a, e) => (S(), d(o(f), null, {
products: t(() => [...e[2] || (e[2] = [])]),
sections: t(({ close: u }) => [
r(o(w), null, {
title: t(() => [...e[3] || (e[3] = [
i("Team", -1)
])]),
default: t(() => [
r(o(M), {
modelValue: a.activeWorkspace.id,
workspaceOptions: c.value,
onCreateWorkspace: e[0] || (e[0] = (s) => n("create:workspace")),
"onUpdate:modelValue": e[1] || (e[1] = (s) => n("select:workspace", s))
}, null, 8, ["modelValue", "workspaceOptions"]),
r(o(C), {
is: o(x),
icon: o(W),
to: "/settings",
onClick: u
}, {
default: t(() => [...e[4] || (e[4] = [
i(" Settings ", -1)
])]),
_: 1
}, 8, ["is", "icon", "onClick"])
]),
_: 2
}, 1024),
r(o(V)),
r(o(v))
]),
_: 1
}));
}
});
export {
L as default
};