@scalar/api-client
Version:
the open source API testing client
35 lines (34 loc) • 1.07 kB
JavaScript
import { defineComponent as u, createBlock as o, openBlock as r, unref as e, withCtx as i, renderSlot as p, createCommentVNode as s } from "vue";
import { ScalarButton as d, ScalarHotkey as k } from "@scalar/components";
import { useLayout as m } from "../../hooks/useLayout.js";
const g = /* @__PURE__ */ u({
__name: "SidebarButton",
props: {
click: { type: Function },
hotkey: {}
},
setup(a) {
const l = a, { layout: n } = m(), c = () => {
l.click();
};
return (t, h) => (r(), o(e(d), {
class: "bg-b-1 text-c-1 hover:bg-b-2 group relative h-auto w-auto border px-2 py-1 md:w-full md:p-1.5",
icon: "Plus",
variant: "outlined",
onClick: c
}, {
default: i(() => [
p(t.$slots, "title"),
t.hotkey && e(n) === "desktop" ? (r(), o(e(k), {
key: 0,
class: "text-c-2 add-item-hotkey absolute right-2 hidden group-hover:opacity-80 md:flex",
hotkey: t.hotkey
}, null, 8, ["hotkey"])) : s("", !0)
]),
_: 3
}));
}
});
export {
g as default
};