Skip to content

armgit / uzu

Public Imported from GitHub
0

A high-performance inference engine for AI models

738 B
Raw Blame
import type { MouseEvent, ReactNode } from "react";
import { Button } from "./button";

type IconActionProps = {
  label: string;
  icon: ReactNode;
  onClick?: () => void;
  className?: string;
};

export function IconAction({ label, icon, onClick, className }: IconActionProps) {
  const handleClick = (event: MouseEvent<HTMLButtonElement>) => {
    event.stopPropagation();
    onClick?.();
  };

  return (
    <Button
      size="xs"
      kind="ghost"
      iconOnly
      ariaLabel={label}
      icon={icon}
      onClick={handleClick}
      className={
        className ??
        "size-7 rounded-full bg-transparent text-text-muted hover:bg-border-default hover:text-text-primary active:bg-border-default"
      }
    />
  );
}