mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-05 18:38:54 +03:00
add embedded mode to BaseSection so parents can host the save action
This commit is contained in:
@@ -175,6 +175,9 @@ export interface BaseSectionProps {
|
||||
isSavingAll?: boolean;
|
||||
/** Callback when this section's saving state changes */
|
||||
onSavingChange?: (isSaving: boolean) => void;
|
||||
/** When true, render the form fields only; suppress the internal save/undo bar.
|
||||
* The parent owns the save action and reads pending data via `onPendingDataChange`. */
|
||||
embedded?: boolean;
|
||||
}
|
||||
|
||||
export interface CreateSectionOptions {
|
||||
@@ -211,6 +214,7 @@ export function ConfigSection({
|
||||
onDeleteProfileSection,
|
||||
isSavingAll = false,
|
||||
onSavingChange,
|
||||
embedded = false,
|
||||
}: ConfigSectionProps) {
|
||||
// For replay level, treat as camera-level config access
|
||||
const effectiveLevel = level === "replay" ? "camera" : level;
|
||||
@@ -1048,6 +1052,7 @@ export function ConfigSection({
|
||||
}}
|
||||
/>
|
||||
|
||||
{!embedded && (
|
||||
<div
|
||||
className={cn(
|
||||
"w-full border-t border-secondary bg-background pt-0",
|
||||
@@ -1163,6 +1168,7 @@ export function ConfigSection({
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<AlertDialog open={isResetDialogOpen} onOpenChange={setIsResetDialogOpen}>
|
||||
<AlertDialogContent>
|
||||
|
||||
Reference in New Issue
Block a user