import { useSearchParams } from "react-router-dom";
import ViewTabs from "../../components/ViewTabs";
import NotificationSettings from "./NotificationSettings";
import AlertTicketSettings from "./AlertTicketSettings";
import DisplaySettings from "./DisplaySettings";
import BadgeSettings from "./BadgeSettings";
import BackupSettings from "./BackupSettings";
import LogSettings from "./LogSettings";
import CacheSettings from "./CacheSettings";
// Settings used to have twelve tabs of its own. Three of them gather the ones that belong together; each part is the same page it always was,
// switched by `?view=` (so it can be linked to, and the old addresses redirect here).
/** Notifications, and — beside it — opening an osTicket ticket for an alert. */
export function NotificationsGroup() {
const [params] = useSearchParams();
const view = params.get("view") === "tickets" ? "tickets" : "notifications";
return (
<>
{view === "tickets" ? : }
>
);
}
/** How things look: dates, times and table sizes, and the colours of the badges. */
export function DisplayGroup() {
const [params] = useSearchParams();
const view = params.get("view") === "badges" ? "badges" : "display";
return (
<>
{view === "badges" ? : }
>
);
}
/** The upkeep of the app's own data: its backups, how long its logs are kept, and the DNS record cache. */
export function DataGroup() {
const [params] = useSearchParams();
const asked = params.get("view");
const view = asked === "logs" || asked === "cache" ? asked : "backup";
return (
<>
{view === "logs" ? : view === "cache" ? : }
>
);
}