Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion site/src/components/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ const avatarVariants = cva(
export type AvatarProps = AvatarPrimitive.AvatarProps &
VariantProps<typeof avatarVariants> & {
src?: string;

fallback?: string;
};

Expand Down
19 changes: 15 additions & 4 deletions site/src/pages/AuditPage/AuditLogRow/AuditLogRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
determineGroupDiff,
determineIdPSyncMappingDiff,
} from "./AuditLogDiff/auditUtils";
import { NetworkIcon } from "lucide-react";

const httpStatusColor = (httpStatus: number): ThemeRole => {
// Treat server errors (500) as errors
Expand Down Expand Up @@ -101,10 +102,20 @@ export const AuditLogRow: FC<AuditLogRowProps> = ({
css={styles.auditLogHeaderInfo}
>
<Stack direction="row" alignItems="center" css={styles.fullWidth}>
<Avatar
fallback={auditLog.user?.username ?? "?"}
src={auditLog.user?.avatar_url}
/>
{/*
* Session logs don't have an associated user to the log,
* so when it happens we display a default icon to represent non user actions
*/}
{auditLog.user ? (
<Avatar
fallback={auditLog.user.username}
src={auditLog.user.avatar_url}
/>
) : (
<Avatar>
<NetworkIcon className="h-full w-full p-1" />
</Avatar>
)}

<Stack
alignItems="baseline"
Expand Down
Loading