'use client' import type { EntityVersionWithAuthor } from '@admin/actions/entity-versions' import { Drawer, DrawerContent, DrawerDescription, DrawerHeader, DrawerTitle } from '@admin/components/ui/drawer' import { ScrollArea } from '@admin/components/ui/scroll-area' import { EntityVersionItem } from './entity-version-item' import { EntityVersionsCurrentRow } from './entity-versions-current-row' interface EntityVersionsDrawerAuthor { name: string email: string image?: string | null } interface EntityVersionsDrawerProps { open: boolean onOpenChange: (open: boolean) => void entityType: string versions: EntityVersionWithAuthor[] isPending: boolean currentUpdatedAt: Date | string currentAuthor: EntityVersionsDrawerAuthor | null restoreVersionAction: (versionId: string) => Promise onRestored: () => void } export function EntityVersionsDrawer({ open, onOpenChange, entityType, versions, isPending, currentUpdatedAt, currentAuthor, restoreVersionAction, onRestored }: EntityVersionsDrawerProps) { return ( Versions Review previous {entityType} versions and restore a saved state.
{isPending ? (

Loading versions…

) : null} {!isPending && versions.length === 0 ? (

No previous versions yet.

) : null} {versions.map((version) => ( ))}
) }