Billing Audit Logs
An audit log scoped to financial and plan changes, for a compliance or admin screen where billing history needs to stay separate from general account activity. Each entry shows the action, who or what performed it with a distinct icon for a person versus an automated system, the IP address when available, a timestamp, and a success or failed status badge. A CSV export link sits in the footer.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge, button dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/billing-audit-logs.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing22.tsx instead.
Usage
The file also exports billing22Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Billing22, billing22Demo } from "@/components/blocks/billing/billing22"; export default function Page() { return <Billing22 {...billing22Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | "Billing audit log" | Header text. |
| description | string | none | Optional line under the header. |
| entries | BillingAuditLogEntry[] | none | Log rows, rendered in the order given, newest first is the caller's responsibility. |
| exportLabel | string | "Export CSV" | Label on the export button. |
| exportHref | string | none | Link target for the export action. The footer is omitted entirely if not set. |
| className | string | none | Extra classes for the outer container. |
Types
interface BillingAuditLogEntry { id: string; action: string; actorName: string; actorType: "user" | "system"; ip?: string; timestamp: string; status: "success" | "failed"; }
Behavior notes
- Entries render in the order passed in, with no built-in sort, so hand them in newest-first if that's the order you want on screen.
- actorType picks the row icon from an internal lookup, a person icon for 'user' and a bot icon for 'system', there's no icon prop to pass in directly.
- The IP address is optional per entry and, when present, is shown inline next to the actor name and timestamp separated by middle dots.
- The export footer, including the button, only renders when exportHref is provided.
- There's no built-in pagination or filtering. Long lists just keep growing vertically, so page or filter the entries array yourself before passing it in.
Frequently asked questions
More Billing Blocks
View all →Billing Invoice List
Invoice history table with status badges, formatted amounts, and a per-row download link, built with shadcn/ui and Tailwind CSS.
Billing Failed Payment Alert
High-contrast failed-payment alert with a message, a retry button, and an optional update-payment-method button, built with shadcn/ui and Tailwind CSS.
Billing Credit Balance
Compact credit balance card with a large total, an optional purchased-versus-promotional breakdown, a low-balance notice, and a top-up button.
Billing Payment Methods
A saved payment method list for React and Next.js with brand icons, a default badge, near-expiry warnings, and remove/set-default actions per row.
Billing Add Card
A card entry form for React and Next.js with auto-formatted fields, internal brand detection, and per-field validation feedback built with shadcn/ui and Tailwind CSS.
Billing Coupon Code
An inline promo code input for React and Next.js with a simulated loading state, an applied summary showing the discount amount, and an invalid-code message.