aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/views/common/button/IconButton.tsx
blob: 56c6258831c44572f5520e13812049d0f95314b4 (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
import classNames from "classnames";
import React from "react";

export type IconButtonProps = {
  icon: string;
  color?: string;
  large?: boolean;
} & React.ComponentPropsWithRef<"i">;

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

  return (
    <i
      className={classNames(
        "cru-icon-button",
        large && "large",
        "bi-" + icon,
        color ? "cru-" + color : "cru-primary",
        className
      )}
      {...otherProps}
    />
  );
}