Lemma Activity Feed
lemma/lemma-activity-feedFreeBlock
A unified audit feed that merges record changes, workflow events, and comments from multiple tables into a single timeline with date grouping, event-type icons, and relative timestamps.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/lemma-work/lemma-platform/main/lemma-typescript/public/r/lemma-activity-feed.jsonSource
1"use client"23import * as React from "react"4import {5 Activity,6 Calendar,7 Database,8 FileText,9 MessageSquare,10 RefreshCw,11 User,12 Zap,13} from "lucide-react"14import { Button } from "@/components/lemma/ui/button"15import { Skeleton } from "@/components/lemma/ui/skeleton"16import { useRecords } from "lemma-sdk/react"17import type { LemmaClient } from "lemma-sdk"18import { cn } from "@/components/lemma/lib/utils"19import { enumPillClasses, type EnumColorMap } from "./activity-enum-utils"20import {21 activityRadiusClassName,22 type LemmaActivityAppearance,23 type LemmaActivityDensity,24 type LemmaActivityRadius,25} from "./activity-style-utils"2627export type { LemmaActivityAppearance, LemmaActivityDensity, LemmaActivityRadius } from "./activity-style-utils"2829export interface ActivitySource {30 tableName: string31 label?: string32 timestampField: string33 descriptionField?: string34 typeField?: string35 userField?: string36 iconField?: string37 filters?: Array<{ field: string; op: string; value: unknown }>38 limit?: number39}4041export type ActivityEventType = "create" | "update" | "delete" | "comment" | "workflow" | "system" | "custom"4243export interface LemmaActivityFeedProps {44 client: LemmaClient45 podId?: string46 enabled?: boolean4748 sources: ActivitySource[]49 enumColorMap?: EnumColorMap5051 appearance?: LemmaActivityAppearance52 density?: LemmaActivityDensity53 radius?: LemmaActivityRadius5455 title?: React.ReactNode56 headerActions?: React.ReactNode57 className?: string58 onEventClick?: (event: ActivityEvent, source: ActivitySource) => void59}6061export interface ActivityEvent {62 id: string63 timestamp: Date64 description: string65 type: ActivityEventType66 tableName: string67 source: string68 user?: string69 icon?: string70 record: Record<string, unknown>71}7273export function LemmaActivityFeed({74 client,75 podId,76 enabled = true,77 sources,78 enumColorMap,79 appearance = "default",80 density = "comfortable",81 radius = "lg",82 title,83 headerActions,84 className,85 onEventClick,86}: LemmaActivityFeedProps) {87 const sourceResults = sources.map((source) => ({88 source,89 state: useRecords({90 client,91 podId,92 tableName: source.tableName,93 filters: source.filters as Array<{ field: string; op: string; value: unknown }> | undefined,94 limit: source.limit ?? 50,95 sortBy: source.timestampField,96 order: "desc",97 enabled,98 }),99 }))100101 const allEvents = React.useMemo(() => {102 const events: ActivityEvent[] = []103// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from lemma
All 20 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Lemma Action Surfacelemma-action-surface | lemma | Blocks | Free | 4 deps | |
| Lemma Agent Conversation Experiencelemma-assistant-experience | lemma | Blocks | Free | 7 deps · 3 files | |
| Lemma Breadcrumbslemma-breadcrumbs | lemma | Blocks | Free | 3 deps | |
| Lemma Commentslemma-comments | lemma | Blocks | Free | 4 deps · 3 files | |
| Lemma Detail Panellemma-detail-panel | lemma | Blocks | Free | 4 deps · 7 files | |
| Lemma Document Workspacelemma-document-workspace | lemma | Blocks | Free | 6 deps | |
| Lemma File Browserlemma-file-browser | lemma | Blocks | Free | 4 deps | |
| Lemma Global Searchlemma-global-search | lemma | Blocks | Free | 4 deps |
