Only show button if no scenario selected

This commit is contained in:
Daniel Roth 2026-03-03 11:16:05 +00:00
parent 5fc3cb60e2
commit 9299d2a76f
2 changed files with 1 additions and 10 deletions

View file

@ -30,7 +30,6 @@ import { CSS } from "@dnd-kit/utilities";
import { ScenarioSummary } from "./types";
export interface RecommendationsOptionsProps {
onApply: (value: CategorisationTriggerRequest) => void | Promise<void>;
disabled?: boolean;
scenarios: ScenarioSummary[]
portfolioId: number
@ -111,7 +110,6 @@ function SortableScenarioItem({
}
export function RecommendationsOptions({
onApply,
disabled = false,
scenarios,
portfolioId
@ -182,12 +180,6 @@ export function RecommendationsOptions({
body: JSON.stringify(payload)
});
await onApply(payload.scenarios_to_consider ? payload : {
portfolio_id: 123,
scenarios_to_consider: null,
scenario_priority_order: null,
});
setIsApplying(false);
setOpen(false);
};

View file

@ -267,9 +267,8 @@ export function ReportingClientArea({
</button>
</div>
)}
{
{ !selectedScenarioId &&
<RecommendationsOptions
onApply={() => {console.log('Generat Recommendations')}}
disabled={scenarioBusy}
scenarios={scenarios}
portfolioId={portfolioId}