From a06acf6bfb6a6b85e86fe349e3fcac7797c59d5d Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 15 Oct 2021 04:19:15 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=94=20Document=20`SafetyButton`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/elements/SafetyButton.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/components/elements/SafetyButton.tsx b/frontend/src/components/elements/SafetyButton.tsx index 6230908..4d37860 100644 --- a/frontend/src/components/elements/SafetyButton.tsx +++ b/frontend/src/components/elements/SafetyButton.tsx @@ -5,11 +5,19 @@ import * as React from "react" import Style from "./SafetyButton.module.css" +/** + * Props of the {@link SafetyButton}. + */ export interface SafetyButtonProps extends ButtonProps { 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 { const [timerStarted, setTimerStarted] = React.useState(false) const [timerElapsed, setTimerElapsed] = React.useState(false)