fix: display None when there are no apps (#4797)

This commit is contained in:
Bruno Quaresma
2022-10-28 19:37:45 +00:00
committed by GitHub
parent d2fac850cb
commit 6add465365
3 changed files with 17 additions and 1 deletions
@@ -33,3 +33,12 @@ BunchOfApps.args = {
],
},
}
export const NoApps = Template.bind({})
NoApps.args = {
...Example.args,
agent: {
...MockWorkspaceAgent,
apps: [],
},
}
@@ -1,5 +1,6 @@
import { makeStyles } from "@material-ui/core/styles"
import { AppPreviewLink } from "components/AppLink/AppPreviewLink"
import { Maybe } from "components/Conditionals/Maybe"
import { FC } from "react"
import { useTranslation } from "react-i18next"
import { combineClasses } from "util/combineClasses"
@@ -91,6 +92,11 @@ export const AgentRowPreview: FC<AgentRowPreviewProps> = ({
{agent.apps.map((app) => (
<AppPreviewLink key={app.slug} app={app} />
))}
<Maybe condition={agent.apps.length === 0}>
<span className={styles.agentDataValue}>
{t("labels.noApps")}
</span>
</Maybe>
</Stack>
</Stack>
</Stack>
+2 -1
View File
@@ -7,6 +7,7 @@
"labels": {
"agent": "Agent",
"os": "OS",
"apps": "Apps"
"apps": "Apps",
"noApps": "None"
}
}