Version History

File version history panel

SaaSFile Management

Overview

VersionHistoryPanel displays a chronological list of file versions with version number, author, timestamp, and optional comments. Each version supports preview, restore, and download actions. The current version is highlighted. Supports loading, error, empty states, and an optional create-new-version button with a comment dialog.

Usage

import { VersionHistoryPanel } from "@leanicon/web-builder-library/saas";

<VersionHistoryPanel
  file={{
    id: "file-1",
    name: "proposal.docx",
    mimeType: "application/msword",
    size: 2500000,
    status: "approved",
    folderId: "folder-1",
    createdAt: "2024-01-01T10:00:00Z",
    updatedAt: "2024-01-20T15:30:00Z",
    createdBy: { id: "user-1", name: "John Doe", email: "[email protected]" },
  }}
  versions={[
    {
      id: "v2",
      fileId: "file-1",
      versionNumber: 2,
      size: 2500000,
      createdAt: "2024-01-20T15:30:00Z",
      createdBy: { id: "user-1", name: "John Doe", email: "[email protected]" },
      comment: "Final version",
      isCurrent: true,
    },
    {
      id: "v1",
      fileId: "file-1",
      versionNumber: 1,
      size: 1800000,
      createdAt: "2024-01-01T10:00:00Z",
      createdBy: { id: "user-1", name: "John Doe", email: "[email protected]" },
      isCurrent: false,
    },
  ]}
  onPreview={(v) => console.log("Preview:", v)}
  onRestore={async (v) => console.log("Restore:", v)}
  onDownload={(v) => console.log("Download:", v)}
/>;

Variants

Default

Version History

4
Version 4Current
Jan 20, 2024 • Jane Smith
2.38 MB

Final version with all feedback incorporated

3
Version 3
Jan 18, 2024 • John Doe
2.29 MB

Added budget section

2
Version 2
Jan 15, 2024 • John Doe
2.1 MB

Updated timeline and milestones

1
Version 1
Jan 1, 2024 • John Doe
1.72 MB

Default (Dark)

Version History

2
Version 2Current
Jan 20, 2024 • Jane Smith
2.38 MB

Final version

1
Version 1
Jan 1, 2024 • John Doe
1.72 MB

With Create Button

Version History

2
Version 2Current
Jan 20, 2024 • John Doe
2.38 MB

Updated content

1
Version 1
Jan 1, 2024 • John Doe
1.72 MB

Single Version

Version History

1
Version 1Current
Jan 20, 2024 • John Doe
2.38 MB

Initial version

Empty

No version history

Versions are created automatically when the file is edited

Loading

With Error

Failed to load version history. Please try again.