UNPKG

@scalar/api-client

Version:

the open source API testing client

36 lines (35 loc) 1.09 kB
import { defineComponent as i, createBlock as o, openBlock as e, unref as r, withCtx as u, renderSlot as p, createCommentVNode as s } from "vue"; import { ScalarButton as m } from "@scalar/components"; import d from "../ScalarHotkey.vue.js"; import { useLayout as k } from "../../hooks/useLayout.js"; const g = /* @__PURE__ */ i({ __name: "SidebarButton", props: { click: { type: Function }, hotkey: {} }, setup(n) { const a = n, { layout: c } = k(), l = () => { a.click(); }; return (t, h) => (e(), o(r(m), { 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: l }, { default: u(() => [ p(t.$slots, "title"), t.hotkey && r(c) === "desktop" ? (e(), o(d, { key: 0, class: "text-c-2 add-item-hotkey absolute right-2 hidden group-hover:opacity-80 md:block", hotkey: t.hotkey }, null, 8, ["hotkey"])) : s("", !0) ]), _: 3 })); } }); export { g as default };