nyuchimzizi
Mzizi — an open-architecture project of the Bundu Foundation, operated and developed by Nyuchi. Built on the Five African Minerals palette.
Built by Nyuchi Africav4.0.39
Audit event display with actor, action, target, timestamp.
View the full component source code below.
import * as React from "react"
import { cn } from "@/lib/utils"
const severityStyles = {
info: "text-[var(--color-primary, var(--color-cobalt, #00B0FF))]",
warning: "text-[var(--status-warning, var(--color-gold, #FFD740))]",
error: "text-destructive",
critical: "text-destructive font-semibold",
} as const
function AuditLogEntry({ loading = false,
actor,
action,
target,
timestamp,
ip,
severity = "info",
className,
...props
}: {
actor: string
action: string
target?: string
timestamp: string
ip?: string
severity?: "info" | "warning" | "error" | "critical"
} & React.ComponentProps<"div">) {
return (
<div
data-slot="audit-log-entry" data-portal="https://design.nyuchi.com/components/audit-log-entry"
data-severity={severity}
className={cn("flex items-center gap-3 py-2 text-sm", className)}
{...props}
>
<span
className={cn("size-1.5 shrink-0 rounded-full", {
"bg-[var(--color-primary, var(--color-cobalt, #00B0FF))]": severity === "info",
"bg-[var(--status-warning, var(--color-gold, #FFD740))]": severity === "warning",
"bg-destructive": severity === "error" || severity === "critical",
})}
/>
<span className="min-w-0 flex-1">
<span className="font-medium text-foreground">{actor}</span>
<span className={cn("mx-1.5", severityStyles[severity])}>{action}</span>
{target && <span className="font-medium text-foreground">{target}</span>}
</span>
{ip && <span className="shrink-0 font-mono text-xs text-muted-foreground">{ip}</span>}
<span className="shrink-0 text-xs text-muted-foreground">{timestamp}</span>
</div>
)
}
export { AuditLogEntry }
npx shadcn@latest add https://mzizi.dev/api/v1/ui/audit-log-entryFetch this component's metadata and source code from the registry API.
/api/v1/ui/audit-log-entrycomponents/ui/audit-log-entry.tsx