feat: add icons to kmenu
This commit is contained in:
@ -18,6 +18,7 @@ export const menus: Record<string, Menu> = {
|
||||
{
|
||||
title: "Create new article",
|
||||
meta: "",
|
||||
icon: "IconSquareRoundedPlus",
|
||||
cb: (state) => {
|
||||
state.menus["input_link"] = {
|
||||
title: "Link:",
|
||||
@ -48,6 +49,7 @@ export const menus: Record<string, Menu> = {
|
||||
},
|
||||
{
|
||||
title: "Clear Cache",
|
||||
icon: "IconRefresh",
|
||||
cb: async (state) => {
|
||||
state.activeState.value = "loading";
|
||||
await fetch("/api/cache", {
|
||||
@ -60,6 +62,7 @@ export const menus: Record<string, Menu> = {
|
||||
{
|
||||
title: "Add Movie infos",
|
||||
meta: "",
|
||||
icon: "IconReportSearch",
|
||||
cb: async (state, context) => {
|
||||
state.activeState.value = "loading";
|
||||
const movie = context as Movie;
|
||||
|
@ -1,4 +1,7 @@
|
||||
import { Signal } from "@preact/signals";
|
||||
import * as icons from "@components/icons.tsx";
|
||||
|
||||
type IconKey = keyof typeof icons;
|
||||
|
||||
export type MenuState = {
|
||||
activeMenu: Signal<string>;
|
||||
@ -10,10 +13,10 @@ export type MenuState = {
|
||||
|
||||
export type MenuEntry = {
|
||||
cb: (state: MenuState, context: unknown) => void;
|
||||
icon?: IconKey;
|
||||
meta?: string;
|
||||
visible?: boolean | ((context: unknown) => boolean);
|
||||
title: string;
|
||||
icon?: string;
|
||||
};
|
||||
|
||||
export type Menu = {
|
||||
|
Reference in New Issue
Block a user