feat: enhance jobs list stats with tooltips, icons, and refresh count
- Add Tooltip UI component for styled hover tooltips - Replace native title attributes with Tooltip on all job stats - Add refresh icon (green) showing actual refreshed count for metadata refresh - Add icon+tooltip to scanned files stat - Add icon prop to StatBox component - Add refreshed field to stats_json types - Distinct tooltip labels for total links vs refreshed count Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ interface StatBoxProps {
|
||||
value: ReactNode;
|
||||
label: string;
|
||||
variant?: "default" | "primary" | "success" | "warning" | "error";
|
||||
icon?: ReactNode;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
@@ -23,10 +24,13 @@ const valueVariantStyles: Record<string, string> = {
|
||||
error: "text-destructive",
|
||||
};
|
||||
|
||||
export function StatBox({ value, label, variant = "default", className = "" }: StatBoxProps) {
|
||||
export function StatBox({ value, label, variant = "default", icon, className = "" }: StatBoxProps) {
|
||||
return (
|
||||
<div className={`text-center p-4 rounded-lg transition-colors duration-200 ${variantStyles[variant]} ${className}`}>
|
||||
<span className={`block text-3xl font-bold ${valueVariantStyles[variant]}`}>{value}</span>
|
||||
<div className={`flex items-center justify-center gap-1.5 ${valueVariantStyles[variant]}`}>
|
||||
{icon && <span className="text-xl">{icon}</span>}
|
||||
<span className="text-3xl font-bold">{value}</span>
|
||||
</div>
|
||||
<span className={`text-xs text-muted-foreground`}>{label}</span>
|
||||
</div>
|
||||
);
|
||||
|
||||
18
apps/backoffice/app/components/ui/Tooltip.tsx
Normal file
18
apps/backoffice/app/components/ui/Tooltip.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { ReactNode } from "react";
|
||||
|
||||
interface TooltipProps {
|
||||
label: string;
|
||||
children: ReactNode;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function Tooltip({ label, children, className = "" }: TooltipProps) {
|
||||
return (
|
||||
<span className={`relative group/tooltip inline-flex ${className}`}>
|
||||
{children}
|
||||
<span className="pointer-events-none absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2.5 py-1 text-xs text-popover-foreground bg-popover border border-border rounded-lg shadow-lg whitespace-nowrap opacity-0 scale-95 transition-all duration-150 group-hover/tooltip:opacity-100 group-hover/tooltip:scale-100 z-50">
|
||||
{label}
|
||||
</span>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
@@ -19,3 +19,4 @@ export {
|
||||
} from "./Form";
|
||||
export { PageIcon, NavIcon, Icon } from "./Icon";
|
||||
export { CursorPagination, OffsetPagination } from "./Pagination";
|
||||
export { Tooltip } from "./Tooltip";
|
||||
|
||||
Reference in New Issue
Block a user