UNPKG

@scalar/api-client

Version:

the open source API testing client

34 lines (33 loc) 1.05 kB
import { defineComponent as u, createBlock as o, openBlock as r, unref as e, withCtx as i, renderSlot as d, createCommentVNode as s } from "vue"; import { ScalarButton as k, ScalarHotkey as m } from "@scalar/components"; import { useLayout as p } from "../../hooks/useLayout.js"; const x = /* @__PURE__ */ u({ __name: "SidebarButton", props: { click: { type: Function }, hotkey: {} }, setup(t) { const a = t, { layout: c } = p(), l = () => { a.click(); }; return (n, h) => (r(), o(e(k), { 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", variant: "outlined", onClick: l }, { default: i(() => [ d(n.$slots, "title"), t.hotkey && e(c) === "desktop" ? (r(), o(e(m), { 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 { x as default };