mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 13:45:23 +02:00
feat: enable sorting and filtering by Revenue in Weekly Sales grid
This commit is contained in:
@@ -2,7 +2,7 @@ import React, { useState, useRef, useEffect } from 'react';
|
||||
|
||||
export interface NumericFilterConfig {
|
||||
week: string;
|
||||
metric: 'units' | 'spend' | 'gv';
|
||||
metric: 'units' | 'spend' | 'revenue' | 'gv';
|
||||
operator: '=' | '>' | '>=' | '<' | '<=' | 'between';
|
||||
value: number;
|
||||
value2?: number;
|
||||
@@ -10,7 +10,7 @@ export interface NumericFilterConfig {
|
||||
|
||||
interface NumericColumnFilterProps {
|
||||
week: string;
|
||||
metric: 'units' | 'spend' | 'gv';
|
||||
metric: 'units' | 'spend' | 'revenue' | 'gv';
|
||||
currentFilter: NumericFilterConfig | null;
|
||||
onFilterChange: (filter: NumericFilterConfig | null) => void;
|
||||
accentColor?: 'indigo' | 'amber' | 'teal';
|
||||
@@ -127,8 +127,8 @@ export const NumericColumnFilter: React.FC<NumericColumnFilterProps> = ({
|
||||
setIsOpen(!isOpen);
|
||||
}}
|
||||
className={`flex items-center justify-center w-4 h-4 rounded text-[9px] font-black transition-all ${isActive
|
||||
? colors.active
|
||||
: `text-slate-600 ${colors.hover}`
|
||||
? colors.active
|
||||
: `text-slate-600 ${colors.hover}`
|
||||
}`}
|
||||
title={isActive ? `${metric}: ${operatorSymbol} ${currentFilter?.value}${currentFilter?.value2 ? ` - ${currentFilter.value2}` : ''}` : `Filter ${metric}`}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user