style: move Select All to bottom bar of ColumnFilterPopover

This commit is contained in:
Christian Vidal Wolf
2026-04-08 16:59:39 +02:00
parent 89aa222470
commit f3f9f1547f
+21 -32
View File
@@ -52,31 +52,6 @@ export function ColumnFilterPopover({
/> />
</div> </div>
<div className="flex items-center justify-between px-1 border-b border-slate-700/50 pb-2">
<label className="flex items-center gap-2 py-1 px-1.5 hover:bg-slate-700/50 rounded cursor-pointer group">
<div className={cn(
"w-4 h-4 rounded border flex items-center justify-center shrink-0 transition-colors",
isAllSelected ? "bg-blue-600 border-blue-600" : "border-slate-600 bg-slate-900 group-hover:border-slate-500"
)}>
{isAllSelected && <Check className="w-3 h-3 text-white" />}
</div>
<input
type="checkbox"
className="hidden"
checked={isAllSelected}
onChange={() => {
if (isAllSelected) {
onSelectAll([]);
} else {
onSelectAll(uniqueValues);
}
}}
/>
<span className="text-[11px] font-bold text-slate-200">SELECT ALL</span>
</label>
<span className="text-[10px] text-slate-500 font-medium">{selectedValues.length} selected</span>
</div>
<div className="max-h-48 overflow-y-auto space-y-0.5 pr-1 custom-scrollbar"> <div className="max-h-48 overflow-y-auto space-y-0.5 pr-1 custom-scrollbar">
{filteredValues.map(val => ( {filteredValues.map(val => (
<label key={val} className="flex items-center gap-2 p-1.5 hover:bg-slate-700/50 rounded cursor-pointer group"> <label key={val} className="flex items-center gap-2 p-1.5 hover:bg-slate-700/50 rounded cursor-pointer group">
@@ -101,15 +76,29 @@ export function ColumnFilterPopover({
</div> </div>
<div className="flex items-center justify-between pt-2 border-t border-slate-700 mt-1"> <div className="flex items-center justify-between pt-2 border-t border-slate-700 mt-1">
<button <div className="flex items-center gap-4">
onClick={onClear} <button
className="text-[10px] font-bold text-slate-400 hover:text-white transition-colors uppercase" onClick={() => {
> if (isAllSelected) {
Clear onSelectAll([]);
</button> } else {
onSelectAll(uniqueValues);
}
}}
className="text-[11px] font-bold text-slate-400 hover:text-white transition-colors"
>
{isAllSelected ? 'Deselect All' : 'Select All'}
</button>
<button
onClick={onClear}
className="text-[11px] font-bold text-slate-400 hover:text-white transition-colors"
>
Clear Current
</button>
</div>
<button <button
onClick={onClose} onClick={onClose}
className="px-4 py-1.5 bg-blue-600 hover:bg-blue-700 text-white text-[10px] font-black rounded transition-colors shadow-lg active:scale-95" className="px-4 py-1.5 bg-blue-600 hover:bg-blue-700 text-white text-[10px] font-black rounded transition-colors shadow-lg active:scale-95 uppercase"
> >
OK OK
</button> </button>