aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/components/button/IconButton.tsx
blob: 95c5888784c118a269f5792b33c888bc7844d35c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { ComponentPropsWithoutRef } from "react";
import classNames from "classnames";

import { ThemeColor } from "../common";

import "./IconButton.css";

interface IconButtonProps extends ComponentPropsWithoutRef<"i"> {
  icon: string;
  color?: ThemeColor | "grayscale";
  large?: boolean;
  disabled?: boolean; // TODO: Not implemented
}

export default function IconButton(props: IconButtonProps) {
  const { icon, color, className, large, ...otherProps } = props;

  return (
    <button
      className={classNames(
        "cru-icon-button",
        `cru-clickable-${color ?? "grayscale"}`,
        large && "large",
        "bi-" + icon,
        className,
      )}
      {...otherProps}
    />
  );
}