hide option with hide property

This commit is contained in:
Abhinav 2022-08-02 13:37:34 +05:30
parent e894954239
commit 7a5d6b89c7

View file

@ -15,36 +15,37 @@ export const OptionWithInfo = (props) => (
</Option> </Option>
); );
const LabelWithInfo = ({ data }: { data: SearchOption }) => ( const LabelWithInfo = ({ data }: { data: SearchOption }) =>
<> !data.hide && (
<Box className="main" px={2} py={1}> <>
<Typography variant="caption" mb={1}> <Box className="main" px={2} py={1}>
{constants.SEARCH_TYPE(data.type)} <Typography variant="caption" mb={1}>
</Typography> {constants.SEARCH_TYPE(data.type)}
<SpaceBetweenFlex> </Typography>
<Box mr={1}> <SpaceBetweenFlex>
<FreeFlowText> <Box mr={1}>
<Typography fontWeight={'bold'}> <FreeFlowText>
{data.label} <Typography fontWeight={'bold'}>
{data.label}
</Typography>
</FreeFlowText>
<Typography color="text.secondary">
{constants.PHOTO_COUNT(data.fileCount)}
</Typography> </Typography>
</FreeFlowText> </Box>
<Typography color="text.secondary">
{constants.PHOTO_COUNT(data.fileCount)}
</Typography>
</Box>
<Stack direction={'row'} spacing={1}> <Stack direction={'row'} spacing={1}>
{data.previewFiles.map((file) => ( {data.previewFiles.map((file) => (
<CollectionCard <CollectionCard
key={file.id} key={file.id}
latestFile={file} latestFile={file}
onClick={() => null} onClick={() => null}
collectionTile={ResultPreviewTile} collectionTile={ResultPreviewTile}
/> />
))} ))}
</Stack> </Stack>
</SpaceBetweenFlex> </SpaceBetweenFlex>
</Box> </Box>
<Divider sx={{ mx: 2, my: 1 }} /> <Divider sx={{ mx: 2, my: 1 }} />
</> </>
); );