lodash-es#size TypeScript Examples
The following examples show how to use
lodash-es#size.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SelectApplicationView.tsx From github-deploy-center with MIT License | 6 votes |
SelectApplicationView = () => {
const { applicationsById, selectedApplicationId } = useAppState()
const { selectApplication, editApplication, editDeployment } = useActions()
const sortedApplications = orderBy(applicationsById, (x) =>
x.name.toLowerCase()
)
return size(sortedApplications) ? (
<Box display="flex" alignItems="center" style={{ gap: '1rem' }}>
<FormControl variant="outlined" style={{ flex: 1 }}>
<InputLabel id="application-select-label">Application</InputLabel>
<Select
labelId="application-select-label"
label="Application"
onChange={(event) => {
selectApplication(event.target.value as string)
}}
value={selectedApplicationId}>
{map(sortedApplications, (app) => (
<MenuItem value={app.id} key={app.id}>
{app.name}
</MenuItem>
))}
</Select>
</FormControl>
<Button color="secondary" variant="contained" onClick={editApplication}>
Edit App
</Button>
<Button color="secondary" variant="contained" onClick={editDeployment}>
Edit Deploy
</Button>
</Box>
) : null
}