export default function StepAccessControl({
accessControl,
remoteButtonOptions,
selected,
remoteButtons,
remoteQuantity,
onToggle,
onSetRemoteButtons,
onSetRemoteQuantity,
onBack,
onNext,
}) {
return (
Step 3: Access Control
Select the access control methods for your gate (choose one or more)
{accessControl.map((ac) => {
const isSelected = selected.includes(ac.id);
const isRemote = ac.id === 'remote-kit';
return (
{isSelected && isRemote && (
{remoteButtonOptions.map((opt) => {
const isBtnSelected = remoteButtons === Number(opt.id);
return (
);
})}
{remoteQuantity}
{remoteQuantity > 1 ? 'remotes' : 'remote'}
)}
);
})}
{selected.length === 0
? 'No access control selected (you can skip this step)'
: `${selected.length} item${selected.length > 1 ? 's' : ''} selected`}
);
}