add embedded mode to BaseSection so parents can host the save action

This commit is contained in:
Josh Hawkins 2026-05-16 06:43:57 -05:00
parent c6eadfebb8
commit f9600cafe3

View File

@ -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>