diff --git a/src/CycleCountdown.tsx b/src/CycleCountdown.tsx index cffc6a9..e3fcd98 100644 --- a/src/CycleCountdown.tsx +++ b/src/CycleCountdown.tsx @@ -24,6 +24,22 @@ export interface CycleCountdownProps { } } +/** + * This function combines the CycleProgress and Countdown components to create a circular progress bar with a countdown in the middle + * + * @param expiresAt - Date when the countdown should expire + * @param totalDuration - Total duration of the countdown in seconds, which is needed to compute the progress in percent + * @param size - Size of the progress bar, can be 'sm' or 'md' + * @param color - Color of the progress bar (static for the moment) + * @param strokeWidthRem - Width of the progress bar. For small size, a smaller value is recommended + * @param isStatic - If true, the countdown will not be running, but instead show the initial value. However, as the end value is given by a date, reloading can modify the displayed countdown value + * @param formatter - Function to format the countdown value + * @param onExpire - Function that is executed when the countdown expires + * @param onUpdate - Function that is executed when the countdown is updated (not when it expires) + * @param data - Optional data object that can be used for testing (e.g. data-test or data-cy) + * @param className - Optional className object allows you to override the default styling + * @returns A circular progress bar with a countdown in the middle + */ export function CycleCountdown({ expiresAt, totalDuration,