feat(dashboard): flag restricted events with a lock icon in Recent Events
This commit is contained in:
parent
03c8794026
commit
2231cc86ee
2 changed files with 6 additions and 1 deletions
|
|
@ -180,6 +180,7 @@ export default async function HomePage() {
|
||||||
system: e.system ?? true,
|
system: e.system ?? true,
|
||||||
actor: e.actor as number | User | null | undefined,
|
actor: e.actor as number | User | null | undefined,
|
||||||
structure: e.structure as number | GameStructure | null | undefined,
|
structure: e.structure as number | GameStructure | null | undefined,
|
||||||
|
visibility: (e.visibility as "public" | "restricted" | null) ?? "public",
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Fetch active campaigns for the sidebar
|
// Fetch active campaigns for the sidebar
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import type { GameStructure, User } from "@/payload-types";
|
import type { GameStructure, User } from "@/payload-types";
|
||||||
import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item";
|
import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item";
|
||||||
import { BookOpenTextIcon, ScrollTextIcon } from "lucide-react";
|
import { BookOpenTextIcon, LockIcon, ScrollTextIcon } from "lucide-react";
|
||||||
import { formatType } from "@/utils/event-log/formatType";
|
import { formatType } from "@/utils/event-log/formatType";
|
||||||
|
|
||||||
interface EventEntry {
|
interface EventEntry {
|
||||||
|
|
@ -11,6 +11,7 @@ interface EventEntry {
|
||||||
system: boolean;
|
system: boolean;
|
||||||
actor?: number | User | null;
|
actor?: number | User | null;
|
||||||
structure?: number | GameStructure | null;
|
structure?: number | GameStructure | null;
|
||||||
|
visibility?: "public" | "restricted" | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RecentEventsProps {
|
interface RecentEventsProps {
|
||||||
|
|
@ -86,6 +87,9 @@ export function RecentEvents({ events, currentUserId }: RecentEventsProps) {
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
<span className="capitalize">{formatType(event.type)}</span>
|
<span className="capitalize">{formatType(event.type)}</span>
|
||||||
|
{event.visibility === "restricted" && (
|
||||||
|
<LockIcon className="size-3 text-amber-400 shrink-0" />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<span className={`min-w-0 ${isNarrative ? "text-amber-100/90" : ""}`}>
|
<span className={`min-w-0 ${isNarrative ? "text-amber-100/90" : ""}`}>
|
||||||
{event.message}
|
{event.message}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue