mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
Only show button if no scenario selected
This commit is contained in:
parent
5fc3cb60e2
commit
9299d2a76f
2 changed files with 1 additions and 10 deletions
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -267,9 +267,8 @@ export function ReportingClientArea({
|
|||
</button>
|
||||
</div>
|
||||
)}
|
||||
{
|
||||
{ !selectedScenarioId &&
|
||||
<RecommendationsOptions
|
||||
onApply={() => {console.log('Generat Recommendations')}}
|
||||
disabled={scenarioBusy}
|
||||
scenarios={scenarios}
|
||||
portfolioId={portfolioId}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue