header rekated fixes

This commit is contained in:
IGNY8 VPS (Salman)
2025-12-27 05:33:05 +00:00
parent fd6e7eb2dd
commit 726d945bda
15 changed files with 414 additions and 232 deletions

View File

@@ -142,6 +142,14 @@ interface TablePageTemplateProps {
icon?: ReactNode;
variant?: 'primary' | 'success' | 'danger';
}>;
// Next action button for workflow guidance (shown in action bar)
nextAction?: {
label: string;
message?: string; // Message to show above button (e.g., "5 selected")
onClick?: () => void;
href?: string;
disabled?: boolean;
};
}
export default function TablePageTemplate({
@@ -178,6 +186,7 @@ export default function TablePageTemplate({
className = '',
customActions,
bulkActions: customBulkActions,
nextAction,
}: TablePageTemplateProps) {
const location = useLocation();
const [isBulkActionsDropdownOpen, setIsBulkActionsDropdownOpen] = useState(false);
@@ -741,6 +750,44 @@ export default function TablePageTemplate({
{createLabel}
</Button>
)}
{/* Next Action Button - Workflow Guidance */}
{nextAction && (
<div className="flex flex-col items-end ml-2">
{nextAction.message && (
<span className="text-xs text-gray-500 dark:text-gray-400 mb-1">{nextAction.message}</span>
)}
{nextAction.href ? (
<a
href={nextAction.href}
className={`inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg transition-colors ${
nextAction.disabled
? 'bg-gray-200 text-gray-400 cursor-not-allowed dark:bg-gray-700 dark:text-gray-500'
: 'bg-success-500 text-white hover:bg-success-600 dark:bg-success-600 dark:hover:bg-success-500'
}`}
>
{nextAction.label}
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 7l5 5m0 0l-5 5m5-5H6" />
</svg>
</a>
) : (
<button
onClick={nextAction.onClick}
disabled={nextAction.disabled}
className={`inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg transition-colors ${
nextAction.disabled
? 'bg-gray-200 text-gray-400 cursor-not-allowed dark:bg-gray-700 dark:text-gray-500'
: 'bg-success-500 text-white hover:bg-success-600 dark:bg-success-600 dark:hover:bg-success-500'
}`}
>
{nextAction.label}
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 7l5 5m0 0l-5 5m5-5H6" />
</svg>
</button>
)}
</div>
)}
</div>
</div>