File size: 805 Bytes
0fa91a4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
export default function TimeFilter({ activeFilter, onFilterChange }) {
  const filters = [
    { key: 'daily', label: 'Daily' },
    { key: 'weekly', label: 'Weekly' },
    { key: 'monthly', label: 'Monthly' },
    { key: 'all', label: 'All Time' },
  ];

  return (
    <div className="flex gap-1 p-1 bg-neutral-100 rounded-lg w-fit">
      {filters.map((filter) => (
        <button
          key={filter.key}
          onClick={() => onFilterChange(filter.key)}
          className={`px-4 py-2 text-sm font-medium rounded-md transition-all duration-200 ${
            activeFilter === filter.key
              ? 'bg-white text-neutral-800 shadow-sm'
              : 'text-neutral-600 hover:text-neutral-800'
          }`}
        >
          {filter.label}
        </button>
      ))}
    </div>
  );
}