hide display type toggle if only one available

This commit is contained in:
jeffvli
2025-12-01 19:01:31 -08:00
parent 94ed91f95c
commit 72e7006cc3
@@ -132,30 +132,32 @@ export const ListConfigMenu = (props: ListConfigMenuProps) => {
title={t('common.configure', { postProcess: 'sentenceCase' })} title={t('common.configure', { postProcess: 'sentenceCase' })}
> >
<Stack gap="xs"> <Stack gap="xs">
<ListConfigTable {availableDisplayTypes.length > 1 && (
options={[ <ListConfigTable
{ options={[
component: ( {
<SegmentedControl component: (
data={availableDisplayTypes} <SegmentedControl
fullWidth data={availableDisplayTypes}
onChange={(value) => { fullWidth
setList(props.listKey, { onChange={(value) => {
display: value as ListDisplayType, setList(props.listKey, {
}); display: value as ListDisplayType,
}} });
size="sm" }}
value={displayType} size="sm"
withItemsBorders={false} value={displayType}
/> withItemsBorders={false}
), />
id: 'displayType', ),
label: t('table.config.general.displayType', { id: 'displayType',
postProcess: 'sentenceCase', label: t('table.config.general.displayType', {
}), postProcess: 'sentenceCase',
}, }),
]} },
/> ]}
/>
)}
<Config displayType={displayType} {...props} /> <Config displayType={displayType} {...props} />
</Stack> </Stack>
</Modal> </Modal>