import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
import { useRange } from "./useRange";
export default function Correction({ information, setSearch, onCorrectionCallback, }) {
    const { correction } = useRange();
    if (!correction || !correction.autocorrectionText)
        return null;
    const corrected = correction?.autocorrectionText ?? "";
    const original = correction?.originalText ?? "";
    const hasCorrected = correction.searchedWithCorrectedText;
    return (_jsx(_Fragment, { children: information(corrected, original, () => {
            setSearch(original);
            onCorrectionCallback && onCorrectionCallback();
        }, hasCorrected, () => {
            setSearch(corrected);
        }) }));
}
