UI/install: fix metaHeader reactive

This commit is contained in:
Johannes Kirschbauer
2025-08-05 19:27:56 +02:00
parent c90b69d499
commit c0bc0417a6

View File

@@ -55,6 +55,16 @@ export const InstallModal = (props: InstallModalProps) => {
{ initialStep: props.initialStep || "init" }, { initialStep: props.initialStep || "init" },
); );
const MetaHeader = () => {
// @ts-expect-error some steps might not have
const HeaderComponent = () => stepper.currentStep()?.title;
return (
<Show when={HeaderComponent()}>
{(C) => <Dynamic component={C()} machineName={props.machineName} />}
</Show>
);
};
return ( return (
<StepperProvider stepper={stepper}> <StepperProvider stepper={stepper}>
<Modal <Modal
@@ -62,18 +72,9 @@ export const InstallModal = (props: InstallModalProps) => {
onClose={() => { onClose={() => {
console.log("Install aborted"); console.log("Install aborted");
}} }}
metaHeader={() => { // @ts-expect-error some steps might not have
// @ts-expect-error some steps might not have a title metaHeader={stepper.currentStep()?.title ? <MetaHeader /> : undefined}
const HeaderComponent = stepper.currentStep()?.title; // @ts-expect-error some steps might not have
return (
<Show when={HeaderComponent}>
{(C) => (
<Dynamic component={C()} machineName={props.machineName} />
)}
</Show>
);
}}
// @ts-expect-error some steps might not have this
disablePadding={stepper.currentStep()?.isSplash} disablePadding={stepper.currentStep()?.isSplash}
> >
{(ctx) => <InstallStepper />} {(ctx) => <InstallStepper />}