import { useLongClick } from "@/app/hook/useLongClick"; import { makeIconClass } from "@/util/util"; import clsx from "clsx"; import { memo, useRef } from "react"; import "./iconbutton.less"; export const IconButton = memo(({ decl, className }: { decl: IconButtonDecl; className?: string }) => { const buttonRef = useRef(null); useLongClick(buttonRef, decl.click, decl.longClick, decl.disabled); return (
{typeof decl.icon === "string" ? : decl.icon}
); });