import type { ReactNode } from "react"; import { Box, Group, Paper, Stack } from "@mantine/core"; import type { ManagePageLayoutProps } from "./manage-page-layout"; import { ManagePageLayout } from "./manage-page-layout"; export interface ManageCollectionPageProps extends Omit { ariaLabel: string; itemCount: number; emptyState: ReactNode; children: ReactNode; } export const ManageCollectionPage = ({ ariaLabel, itemCount, emptyState, children, ...layoutProps }: ManageCollectionPageProps) => ( {itemCount === 0 ? emptyState : {children}} ); /** The `ul` wrapper used by every manage list, so collections rendered outside `ManageCollectionPage` still match. */ export const ManageCollectionList = ({ ariaLabel, children }: { ariaLabel: string; children: ReactNode }) => ( {children} ); export interface ManageCollectionItemProps { leading?: ReactNode; title: ReactNode; description?: ReactNode; metadata?: ReactNode; badges?: ReactNode; actions?: ReactNode; actionsAlignment?: "flex-start" | "center"; } export const ManageCollectionItem = ({ leading, title, description, metadata, badges, actions, actionsAlignment = "flex-start", }: ManageCollectionItemProps) => ( {leading && {leading}} {title} {badges && {badges}} {description} {metadata} {actions && ( {actions} )} );