import { jsx as _jsx } from "react/jsx-runtime";
import clsx from "clsx";
import { Tooltip } from "../../..";
import "./style.scss";
const SearchTimer = ({ remainingTime = 0, className = "", }) => {
    const formatTime = (seconds) => {
        const minutes = Math.floor(seconds / 60);
        const remainingSeconds = seconds % 60;
        return `${minutes > 9 ? "" : 0}${minutes}:${remainingSeconds < 10 ? "0" : ""}${remainingSeconds}`;
    };
    const timerClassName = clsx({
        searchTimer: true,
        [className]: !!className,
    });
    if (!remainingTime) {
        return null;
    }
    return (_jsx(Tooltip, { content: "Your search is in process", children: _jsx("div", { className: timerClassName, children: formatTime(remainingTime) }) }));
};
export default SearchTimer;
