import {LoadingProvider} from "../../hooks/useLoading.jsx";
import {Outlet} from "react-router-dom";
import {ResultList} from "./ResultList.jsx";
import {ResultView} from "./ResultView.jsx";
import {useTranslation} from "react-i18next";

export function ResultRoot() {
    const {t} = useTranslation();

    return <>
        <h1>{t("result", {count: 1})}</h1>
        <LoadingProvider>
            <Outlet/>
        </LoadingProvider>
    </>
}

export function getResultChildren() {
    return [
        {
            path: '',
            element: <ResultList/>
        },
        {
            path: ':uuid',
            element: <ResultView/>
        },
    ]
}
