mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-06-10 09:10:03 +00:00
Resolve https://projekte.kosit.org/kosit/validator/-/issues/97 "Replace docsify from UI"
This commit is contained in:
parent
a10cc14d06
commit
219aeaa1b7
100 changed files with 27369 additions and 1072 deletions
44
server/ui/src/components/Button/Button.tsx
Normal file
44
server/ui/src/components/Button/Button.tsx
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import clsx from "clsx";
|
||||
import type { ButtonHTMLAttributes, DetailedHTMLProps, ReactNode } from "react";
|
||||
import React from "react";
|
||||
import type { ExtendProps } from "../util/types";
|
||||
import styles from "./Button.module.css";
|
||||
|
||||
type HTMLButtonProps = DetailedHTMLProps<
|
||||
ButtonHTMLAttributes<HTMLButtonElement>,
|
||||
HTMLButtonElement
|
||||
>;
|
||||
type ButtonProps = ExtendProps<
|
||||
HTMLButtonProps,
|
||||
{
|
||||
children: ReactNode;
|
||||
type?: "button" | "submit" | "reset";
|
||||
className?: string;
|
||||
loading?: boolean;
|
||||
}
|
||||
>;
|
||||
|
||||
function Button({
|
||||
children,
|
||||
type = "button",
|
||||
className,
|
||||
loading = false,
|
||||
...props
|
||||
}: ButtonProps): JSX.Element {
|
||||
return (
|
||||
<button
|
||||
{...props}
|
||||
className={clsx(styles.button, loading && styles.loading, className)}
|
||||
// eslint-disable-next-line react/button-has-type
|
||||
type={type}
|
||||
aria-busy={loading}
|
||||
>
|
||||
<div className={styles.spinnerWrapper} aria-hidden>
|
||||
<div className={styles.spinner} />
|
||||
</div>
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
export default Button;
|
||||
Loading…
Add table
Add a link
Reference in a new issue