mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-12 15:01:14 +03:00
add embedded mode to BaseSection so parents can host the save action
This commit is contained in:
parent
c6eadfebb8
commit
f9600cafe3
@ -175,6 +175,9 @@ export interface BaseSectionProps {
|
|||||||
isSavingAll?: boolean;
|
isSavingAll?: boolean;
|
||||||
/** Callback when this section's saving state changes */
|
/** Callback when this section's saving state changes */
|
||||||
onSavingChange?: (isSaving: boolean) => void;
|
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 {
|
export interface CreateSectionOptions {
|
||||||
@ -211,6 +214,7 @@ export function ConfigSection({
|
|||||||
onDeleteProfileSection,
|
onDeleteProfileSection,
|
||||||
isSavingAll = false,
|
isSavingAll = false,
|
||||||
onSavingChange,
|
onSavingChange,
|
||||||
|
embedded = false,
|
||||||
}: ConfigSectionProps) {
|
}: ConfigSectionProps) {
|
||||||
// For replay level, treat as camera-level config access
|
// For replay level, treat as camera-level config access
|
||||||
const effectiveLevel = level === "replay" ? "camera" : level;
|
const effectiveLevel = level === "replay" ? "camera" : level;
|
||||||
@ -1048,6 +1052,7 @@ export function ConfigSection({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{!embedded && (
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
"w-full border-t border-secondary bg-background pt-0",
|
"w-full border-t border-secondary bg-background pt-0",
|
||||||
@ -1163,6 +1168,7 @@ export function ConfigSection({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<AlertDialog open={isResetDialogOpen} onOpenChange={setIsResetDialogOpen}>
|
<AlertDialog open={isResetDialogOpen} onOpenChange={setIsResetDialogOpen}>
|
||||||
<AlertDialogContent>
|
<AlertDialogContent>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user