File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
pages/AuditPage/AuditLogRow Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,6 @@ const avatarVariants = cva(
5757export type AvatarProps = AvatarPrimitive . AvatarProps &
5858 VariantProps < typeof avatarVariants > & {
5959 src ?: string ;
60-
6160 fallback ?: string ;
6261 } ;
6362
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { DropdownArrow } from "components/DropdownArrow/DropdownArrow";
1010import { Pill } from "components/Pill/Pill" ;
1111import { Stack } from "components/Stack/Stack" ;
1212import { TimelineEntry } from "components/Timeline/TimelineEntry" ;
13+ import { NetworkIcon } from "lucide-react" ;
1314import { type FC , useState } from "react" ;
1415import { Link as RouterLink } from "react-router-dom" ;
1516import type { ThemeRole } from "theme/roles" ;
@@ -101,10 +102,20 @@ export const AuditLogRow: FC<AuditLogRowProps> = ({
101102 css = { styles . auditLogHeaderInfo }
102103 >
103104 < Stack direction = "row" alignItems = "center" css = { styles . fullWidth } >
104- < Avatar
105- fallback = { auditLog . user ?. username ?? "?" }
106- src = { auditLog . user ?. avatar_url }
107- />
105+ { /*
106+ * Session logs don't have an associated user to the log,
107+ * so when it happens we display a default icon to represent non user actions
108+ */ }
109+ { auditLog . user ? (
110+ < Avatar
111+ fallback = { auditLog . user . username }
112+ src = { auditLog . user . avatar_url }
113+ />
114+ ) : (
115+ < Avatar >
116+ < NetworkIcon className = "h-full w-full p-1" />
117+ </ Avatar >
118+ ) }
108119
109120 < Stack
110121 alignItems = "baseline"
You can’t perform that action at this time.
0 commit comments