So, I'm in the case where I need to build some dynamic borders, in several case, also the case when the color is red in not correct validation.
Here is the dynamic so-called border I have build:
const dynamicBorders = {
borderRight: `1px solid ${color}`,
borderLeft: `1px solid ${color}`,
borderTop: props.isFirst === true ? `1px solid ${color}`: `.5px solid ${color}`,
borderBottom: props.isLast === true ? `1px solid ${color}` : `.5px solid ${color}`,
borderRadius: props.isFirst === true && props.isLast === false ? '10px 10px 0px 0px': props.isFirst === false && props.isLast === true ? '0px 0px 10px 10px' : props.isFirst === true && props.isLast === true && '10px' ? props.isFirst === false && props.isLast === false && '0' : '0px 0px 0px 0px',
};
So with this I have achieved this, but still the border in middle is not correct, I don't know.
So this is one answer from a member, but that doesn't work on error mode, but that fixes the duplicate order.
const dynamicBorders = {
borderRight: `1px solid ${color}`,
borderLeft: `1px solid ${color}`,
borderTop: `1px solid ${color}`,
borderBottom: props.isLast === true ? `1px solid ${color}` : '',
borderRadius: props.isFirst === true && props.isLast === false ? '10px 10px 0px 0px': props.isFirst === false && props.isLast === true ? '0px 0px 10px 10px' : props.isFirst === true && props.isLast === true && '10px' ? props.isFirst === false && props.isLast === false && '0' : '0px 0px 0px 0px',
};
But here is the item when it has an error:
And this is because: const color = props.errorMode === true ? props.error === true ? '#F79DA1' : '#EDEDED' : '#EDEDED'