Skip to content

Commit 3a34e5e

Browse files
committed
removing dead strings in auditLogRow
1 parent d0ba8eb commit 3a34e5e

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

site/src/components/AuditLogRow/AuditLogRow.tsx

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ export const AuditLogRow: React.FC<AuditLogRowProps> = ({
4545
const diffs = Object.entries(auditLog.diff)
4646
const shouldDisplayDiff = diffs.length > 0
4747
const { os, browser } = userAgentParser(auditLog.user_agent)
48-
const displayBrowserInfo = browser.name
49-
? `${browser.name} ${browser.version}`
50-
: t("table.logRow.notAvailable")
5148

5249
let auditDiff = auditLog.diff
5350

@@ -127,21 +124,20 @@ export const AuditLogRow: React.FC<AuditLogRowProps> = ({
127124
<strong>{auditLog.ip}</strong>
128125
</span>
129126
)}
130-
131-
<span className={styles.auditLogInfo}>
132-
<>{t("table.logRow.os")}</>
133-
<strong>
134-
{os.name
135-
? os.name
136-
: // https://github.com/i18next/next-i18next/issues/1795
137-
t<string>("table.logRow.notAvailable")}
138-
</strong>
139-
</span>
140-
141-
<span className={styles.auditLogInfo}>
142-
<>{t("table.logRow.browser")}</>
143-
<strong>{displayBrowserInfo}</strong>
144-
</span>
127+
{os.name && (
128+
<span className={styles.auditLogInfo}>
129+
<>{t("table.logRow.os")}</>
130+
<strong>{os.name}</strong>
131+
</span>
132+
)}
133+
{browser.name && (
134+
<span className={styles.auditLogInfo}>
135+
<>{t("table.logRow.browser")}</>
136+
<strong>
137+
{browser.name} {browser.version}
138+
</strong>
139+
</span>
140+
)}
145141
</Stack>
146142

147143
<Pill

0 commit comments

Comments
 (0)