mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-23 07:14:21 +00:00
📔 Document SafetyButton
This commit is contained in:
parent
aeeca9736f
commit
9df848788e
1 changed files with 8 additions and 0 deletions
|
@ -5,11 +5,19 @@ import * as React from "react"
|
||||||
import Style from "./SafetyButton.module.css"
|
import Style from "./SafetyButton.module.css"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Props of the {@link SafetyButton}.
|
||||||
|
*/
|
||||||
export interface SafetyButtonProps extends ButtonProps {
|
export interface SafetyButtonProps extends ButtonProps {
|
||||||
timeout: number,
|
timeout: number,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@link Button} which locks for a certain `timeout` and asks for confirmation before firing the `onClick` event.
|
||||||
|
*
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
export function SafetyButton({timeout = 3, onClick, children, disabled, className, bluelibClassNames, ...props}: SafetyButtonProps): JSX.Element {
|
export function SafetyButton({timeout = 3, onClick, children, disabled, className, bluelibClassNames, ...props}: SafetyButtonProps): JSX.Element {
|
||||||
const [timerStarted, setTimerStarted] = React.useState<boolean>(false)
|
const [timerStarted, setTimerStarted] = React.useState<boolean>(false)
|
||||||
const [timerElapsed, setTimerElapsed] = React.useState<boolean>(false)
|
const [timerElapsed, setTimerElapsed] = React.useState<boolean>(false)
|
||||||
|
|
Loading…
Reference in a new issue