fix red unsaved dot

This commit is contained in:
Josh Hawkins
2026-02-27 09:40:21 -06:00
parent b9149b6366
commit 5f262621c4
2 changed files with 42 additions and 3 deletions
+11 -2
View File
@@ -1,4 +1,4 @@
import { useState } from "react";
import { useCallback, useState } from "react";
import { useTranslation } from "react-i18next";
import type { SectionConfig } from "@/components/config-form/sections";
import { ConfigSectionTemplate } from "@/components/config-form/sections";
@@ -47,6 +47,7 @@ export function SingleSectionPage({
showOverrideIndicator = true,
selectedCamera,
setUnsavedChanges,
onSectionStatusChange,
pendingDataBySection,
onPendingDataChange,
}: SingleSectionPageProps) {
@@ -62,6 +63,14 @@ export function SingleSectionPage({
isOverridden: false,
});
const handleSectionStatusChange = useCallback(
(status: SectionStatus) => {
setSectionStatus(status);
onSectionStatusChange?.(sectionKey, level, status);
},
[level, onSectionStatusChange, sectionKey],
);
if (level === "camera" && !selectedCamera) {
return (
<div className="flex h-full items-center justify-center text-muted-foreground">
@@ -122,7 +131,7 @@ export function SingleSectionPage({
pendingDataBySection={pendingDataBySection}
onPendingDataChange={onPendingDataChange}
requiresRestart={requiresRestart}
onStatusChange={setSectionStatus}
onStatusChange={handleSectionStatusChange}
/>
</div>
);