feat: dashboard

This commit is contained in:
2023-12-07 15:35:13 +00:00
parent 30907927d1
commit fedf674819
24 changed files with 307 additions and 93 deletions

View File

@ -1,6 +1,7 @@
import "./async-button.css";
import { useState } from "react";
import Spinner from "./spinner";
import classNames from "classnames";
interface AsyncButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
disabled?: boolean;
@ -28,7 +29,7 @@ export default function AsyncButton(props: AsyncButtonProps) {
}
return (
<button type="button" disabled={loading || props.disabled} {...props} onClick={handle}>
<button disabled={loading || props.disabled} {...props} onClick={handle} className={classNames("px-3 py-2 bg-gray-2 rounded-full", props.className)}>
<span style={{ visibility: loading ? "hidden" : "visible" }}>{props.children}</span>
{loading && (
<span className="spinner-wrapper">