import { ActionIcon, CloseButton, NumberInput, Tooltip } from "@mantine/core"; import { IconClock } from "@tabler/icons-react"; import dayjs from "dayjs"; import { Dispatch, SetStateAction } from "react"; export default function TimeInput({ label, value, setValue, allowLeadingZeros = false, error = "", }: { label: string; value: number | string | undefined; setValue: Dispatch>; allowLeadingZeros?: boolean; error?: string | null; }) { return ( setValue("")} style={{ display: Number.isFinite(value) ? "none" : undefined, }} /> } rightSection={ { setValue(dayjs().format("HHmm")); }} > } onChange={setValue} /> ); }