File tree 2 files changed +15
-5
lines changed
pages/AuditPage/AuditLogRow
2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,6 @@ const avatarVariants = cva(
57
57
export type AvatarProps = AvatarPrimitive . AvatarProps &
58
58
VariantProps < typeof avatarVariants > & {
59
59
src ?: string ;
60
-
61
60
fallback ?: string ;
62
61
} ;
63
62
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { DropdownArrow } from "components/DropdownArrow/DropdownArrow";
10
10
import { Pill } from "components/Pill/Pill" ;
11
11
import { Stack } from "components/Stack/Stack" ;
12
12
import { TimelineEntry } from "components/Timeline/TimelineEntry" ;
13
+ import { NetworkIcon } from "lucide-react" ;
13
14
import { type FC , useState } from "react" ;
14
15
import { Link as RouterLink } from "react-router-dom" ;
15
16
import type { ThemeRole } from "theme/roles" ;
@@ -101,10 +102,20 @@ export const AuditLogRow: FC<AuditLogRowProps> = ({
101
102
css = { styles . auditLogHeaderInfo }
102
103
>
103
104
< 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
+ ) }
108
119
109
120
< Stack
110
121
alignItems = "baseline"
You can’t perform that action at this time.
0 commit comments