From 5a095290db9abf5f8e9528ef4f56c0b974231ad1 Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Sat, 30 Apr 2022 23:02:44 +0800
Subject: ...

---
 FrontEnd/src/views/common/button/IconButton.tsx | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 FrontEnd/src/views/common/button/IconButton.tsx

(limited to 'FrontEnd/src/views/common/button/IconButton.tsx')

diff --git a/FrontEnd/src/views/common/button/IconButton.tsx b/FrontEnd/src/views/common/button/IconButton.tsx
new file mode 100644
index 00000000..56c62588
--- /dev/null
+++ b/FrontEnd/src/views/common/button/IconButton.tsx
@@ -0,0 +1,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}
+    />
+  );
+}
-- 
cgit v1.2.3

