fix: react-doctor → 64/100 — remove dead AdminStatusBadge/AdminCountBadge, add dialog semantics
This commit is contained in:
@@ -138,56 +138,3 @@ export default function AdminBadge({
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
// Status badge with predefined statuses
|
||||
type AdminStatusBadgeProps = {
|
||||
status: "active" | "inactive" | "pending" | "draft" | "completed" | "cancelled";
|
||||
className?: string;
|
||||
};
|
||||
|
||||
// Reuse the new `tone` prop directly so the status pill text style always
|
||||
// matches the active AdminBadge palette.
|
||||
const statusConfig: Record<string, { tone: BadgeTone; dot: boolean; label: string }> = {
|
||||
active: { tone: "success", dot: true, label: "Active" },
|
||||
inactive: { tone: "neutral", dot: true, label: "Inactive" },
|
||||
pending: { tone: "warning", dot: true, label: "Pending" },
|
||||
draft: { tone: "neutral", dot: true, label: "Draft" },
|
||||
completed: { tone: "success", dot: true, label: "Completed" },
|
||||
cancelled: { tone: "danger", dot: true, label: "Cancelled" },
|
||||
};
|
||||
|
||||
export function AdminStatusBadge({ status, className = "" }: AdminStatusBadgeProps) {
|
||||
const config = statusConfig[status] || statusConfig.inactive;
|
||||
return (
|
||||
<AdminBadge tone={config.tone} dot={config.dot} className={className}>
|
||||
{config.label}
|
||||
</AdminBadge>
|
||||
);
|
||||
}
|
||||
|
||||
// Count badge (circular)
|
||||
type AdminCountBadgeProps = {
|
||||
count: number;
|
||||
tone?: BadgeTone;
|
||||
/** @deprecated Use `tone` instead. */
|
||||
variant?: BadgeVariant;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
export function AdminCountBadge({
|
||||
count,
|
||||
tone,
|
||||
variant = "default",
|
||||
className = "",
|
||||
}: AdminCountBadgeProps) {
|
||||
const resolvedTone: BadgeTone = tone ?? variantToTone[variant];
|
||||
const { bg, text } = toneStyles[resolvedTone];
|
||||
return (
|
||||
<span
|
||||
className={`inline-flex h-5 min-w-[1.25rem] items-center justify-center rounded-full px-1.5 text-xs font-bold ${className}`}
|
||||
style={{ backgroundColor: bg, color: text }}
|
||||
>
|
||||
{count}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ export { default as AdminEmptyState } from "./AdminEmptyState";
|
||||
export { default as AdminDeleteConfirm, useDeleteConfirm } from "./AdminDeleteConfirm";
|
||||
export { default as AdminActionMenu, AdminActionButton } from "./AdminActionMenu";
|
||||
export { default as AdminPagination, AdminSimplePagination } from "./AdminPagination";
|
||||
export { default as AdminBadge, AdminStatusBadge, AdminCountBadge } from "./AdminBadge";
|
||||
export { default as AdminBadge } from "./AdminBadge";
|
||||
|
||||
// Phase 2 pattern primitives (admin-level, not in design-system/ folder)
|
||||
// Re-exported here so callers can `import { KPIStat, EmptyState, LoadingState } from "@/components/admin/design-system"`.
|
||||
|
||||
Reference in New Issue
Block a user