import { createFileRoute } from "@tanstack/react-router"; import { Box, Button, IconButton, Typography } from "@mui/material"; import ArrowBackIcon from "@mui/icons-material/ArrowBack"; import { useNavigate } from "@tanstack/react-router"; import { ConfigTable } from "../components/ConfigTable"; export const Route = createFileRoute("/config")({ component: ConfigPage, validateSearch: (search: Record): { from?: string } => { const from = typeof search.from === "string" ? search.from : undefined; return { from }; } }); function ConfigPage() { const navigate = useNavigate(); const { from } = Route.useSearch(); const handleAddNewKPI = () => { navigate({ to: "/config-add", search: from ? { from } : undefined }); }; const handleBack = () => { if (from === "pitchbooks") { navigate({ to: "/pitchbooks" }); } else { navigate({ to: "/" }); } }; return ( Konfiguration der Kennzahlen ); }