mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-01-06 16:34:43 +08:00
29 lines
643 B
TypeScript
29 lines
643 B
TypeScript
import * as React from "react";
|
|
|
|
import styles from "./button.module.scss";
|
|
|
|
export function IconButton(props: {
|
|
onClick?: () => void;
|
|
icon: JSX.Element;
|
|
text?: string;
|
|
bordered?: boolean;
|
|
className?: string;
|
|
title?: string;
|
|
}) {
|
|
return (
|
|
<div
|
|
className={
|
|
styles["icon-button"] +
|
|
` ${props.bordered && styles.border} ${props.className ?? ""}`
|
|
}
|
|
onClick={props.onClick}
|
|
title={props.title}
|
|
>
|
|
<div className={styles["icon-button-icon"]}>{props.icon}</div>
|
|
{props.text && (
|
|
<div className={styles["icon-button-text"]}>{props.text}</div>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|