Customisable pax/bag weight

Better log
This commit is contained in:
2025-06-21 21:41:17 +02:00
parent 2047c84d8d
commit 80cb726501
17 changed files with 681 additions and 518 deletions
@@ -0,0 +1,42 @@
import { FC } from 'react';
import { GSX_SERVICE_CALLED, GSX_SERVICE_FINISHED } from '../../constants';
import { LoadingState } from '../../types/general';
import { WASMDataF } from '../../types/WASMData';
import { CoherentCallOptionsSet } from '../../utils/utils';
import ToggleComponent from '../toggleComponent/ToggleComponent';
interface OptionsFProps {
WASMData: WASMDataF;
loadingState: LoadingState;
}
const OptionsF: FC<OptionsFProps> = ({ WASMData, loadingState }) => {
const GSXActive = () => {
return (
(WASMData.GSX.boardingState >= GSX_SERVICE_CALLED || WASMData.GSX.deboardingState >= GSX_SERVICE_CALLED) &&
WASMData.GSX.deboardingState !== GSX_SERVICE_FINISHED
);
};
return (
<>
<div className="block flex w-full flex-col opacity-100 transition-opacity duration-150 ease-linear mb-4">
<div className="relative flex w-full items-center justify-between rounded-md bg-zinc-600 p-2 px-4">
<ToggleComponent
optionName="GSX Sync"
value={WASMData.options.GSXSync}
leftLabel={{ value: true }}
rightLabel={{ value: false }}
backgroundColor="bg-zinc-700"
setValue={(value) => {
CoherentCallOptionsSet(value);
}}
disabled={loadingState !== 'preview' || GSXActive()}
/>
</div>
</div>
</>
);
};
export default OptionsF;