feat(admin): standardize UI components, modal viewports, URL syncing, and add live monitoring
Deploy Canina / deploy (push) Successful in 31s
Deploy Canina / deploy (push) Successful in 31s
This commit is contained in:
1 parent
828c90b4c6
commit
9d63f9a7a4
213 files changed
+247967
-244416
No files matched your search
@@ -0,0 +1,51 @@
|
||||
import React from 'react';
|
||||
import { ArrowUpDown, ArrowUp, ArrowDown } from 'lucide-react';
|
||||
|
||||
export interface ThSortProps {
|
||||
column: string;
|
||||
label: React.ReactNode;
|
||||
currentSortBy: string;
|
||||
currentSortOrder: 'asc' | 'desc';
|
||||
onSort: (column: string) => void;
|
||||
className?: string;
|
||||
align?: 'right' | 'center' | 'left';
|
||||
}
|
||||
|
||||
export default function ThSort({
|
||||
column,
|
||||
label,
|
||||
currentSortBy,
|
||||
currentSortOrder,
|
||||
onSort,
|
||||
className = '',
|
||||
align = 'right',
|
||||
}: ThSortProps) {
|
||||
const isSorted = currentSortBy === column;
|
||||
|
||||
const alignClasses =
|
||||
align === 'left'
|
||||
? 'justify-start text-left'
|
||||
: align === 'center'
|
||||
? 'justify-center text-center'
|
||||
: 'justify-start text-right';
|
||||
|
||||
return (
|
||||
<th
|
||||
onClick={() => onSort(column)}
|
||||
className={`p-4 font-black text-xs text-gray-600 hover:text-purple-700 cursor-pointer select-none transition-colors group ${className}`}
|
||||
>
|
||||
<div className={`flex items-center gap-1.5 ${alignClasses}`}>
|
||||
<span className="group-hover:text-purple-600 transition-colors">{label}</span>
|
||||
{isSorted ? (
|
||||
currentSortOrder === 'asc' ? (
|
||||
<ArrowUp className="w-3.5 h-3.5 text-purple-600 shrink-0" />
|
||||
) : (
|
||||
<ArrowDown className="w-3.5 h-3.5 text-purple-600 shrink-0" />
|
||||
)
|
||||
) : (
|
||||
<ArrowUpDown className="w-3.5 h-3.5 text-gray-300 group-hover:text-gray-400 shrink-0 transition-colors" />
|
||||
)}
|
||||
</div>
|
||||
</th>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user