// Copyright 2023, Command Line Inc. // SPDX-License-Identifier: Apache-2.0 import { useLongClick } from "@/app/hook/useLongClick"; import { makeIconClass } from "@/util/util"; import clsx from "clsx"; import { forwardRef, memo, useRef } from "react"; import "./iconbutton.scss"; type IconButtonProps = { decl: IconButtonDecl; className?: string }; export const IconButton = memo( forwardRef(({ decl, className }, ref) => { ref = ref ?? useRef(null); const spin = decl.iconSpin ?? false; useLongClick(ref, decl.click, decl.longClick, decl.disabled); return ( ); }) );