1
0
mirror of https://github.com/Yidadaa/ChatGPT-Next-Web.git synced 2025-10-31 21:59:19 +08:00
Files
.github
.husky
app
api
components
button.module.scss
button.tsx
chat-list.tsx
chat.module.scss
chat.tsx
error.tsx
home.module.scss
home.tsx
input-range.module.scss
input-range.tsx
markdown.tsx
settings.module.scss
settings.tsx
sidebar.tsx
ui-lib.module.scss
ui-lib.tsx
window.scss
config
icons
locales
store
styles
constant.ts
global.d.ts
layout.tsx
page.tsx
polyfill.ts
requests.ts
utils.ts
docs
public
scripts
.eslintignore
.eslintrc.json
.gitignore
.gitpod.yml
.lintstagedrc.json
.prettierrc.js
CODE_OF_CONDUCT.md
Dockerfile
LICENSE
README.md
README_CN.md
middleware.ts
next.config.js
package.json
tsconfig.json
vercel.json
yarn.lock
ChatGPT-Next-Web/app/components/button.tsx
2023-04-06 21:02:48 +08:00

40 lines
891 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;
shadow?: boolean;
noDark?: boolean;
className?: string;
title?: string;
disabled?: boolean;
}) {
return (
<button
className={
styles["icon-button"] +
` ${props.bordered && styles.border} ${props.shadow && styles.shadow} ${
props.className ?? ""
} clickable`
}
onClick={props.onClick}
title={props.title}
disabled={props.disabled}
role="button"
>
<div
className={styles["icon-button-icon"] + ` ${props.noDark && "no-dark"}`}
>
{props.icon}
</div>
{props.text && (
<div className={styles["icon-button-text"]}>{props.text}</div>
)}
</button>
);
}