'use client';
import type { ReactNode } from 'react';
import { ChevronRight } from '@/components/icons';
import { cn } from '@/lib/utils';
import { AdminLink } from './admin-link';
interface AdminListProps {
children: ReactNode;
className?: string;
}
/** Rows of things the admin manages: plugins, themes, requests. */
export function AdminList({ children, className }: AdminListProps) {
return (
{children}
);
}
interface AdminListRowProps {
/** Makes the whole row open this admin path; the title becomes the link. */
href?: string;
icon?: ReactNode;
title: ReactNode;
/** Badges and other inline bits after the title. */
titleExtra?: ReactNode;
description?: ReactNode;
/** The small line under the description: author, version, dates. */
meta?: ReactNode;
/** Controls on the end side; they sit above the row link. */
control?: ReactNode;
className?: string;
'data-testid'?: string;
}
export function AdminListRow({ href, icon, title, titleExtra, description, meta, control, className, ...rest }: AdminListRowProps) {
return (
{icon && (
{icon}
)}
{href ? (
{title}
) : (
{title}
)}
{titleExtra}
{description &&
{description}
}
{meta &&
{meta}
}
{control &&
{control}
}
{href &&
}
);
}