File size: 1,708 Bytes
cb5d9d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import {
  type RoomCategory,
  type RoomItem,
  categorias,
} from "../../data/roomSetupData";

type FilterButtonProps = {
  category: RoomCategory;
  active: boolean;
  onSelect: (id: string) => void;
};

export function FilterButton({
  category,
  active,
  onSelect,
}: FilterButtonProps) {
  return (
    <button
      type="button"
      onClick={() => onSelect(category.id)}
      className={`px-4 py-2 rounded-lg text-sm font-medium transition-all duration-200 border ${
        active
          ? "bg-[#0047AB] border-[#0047AB] text-white shadow-sm"
          : "bg-white border-[#0047AB] text-[#0047AB] hover:bg-[#eaf1ff]"
      }`}
    >
      {category.label} ({category.count})
    </button>
  );
}

type RoomCardProps = {
  room: RoomItem;
  onSelect: (url: string) => void;
};

export function RoomCard({ room, onSelect }: RoomCardProps) {
  const categoryLabel =
    categorias.find((cat) => cat.id === room.category)?.label ?? room.category;

  return (
    <button
      type="button"
      onClick={() => onSelect(room.img)}
      className="group cursor-pointer text-left"
    >
      <div className="relative aspect-[4/3] rounded-2xl overflow-hidden mb-3 bg-[#edf4ff]">
        <img
          src={room.img}
          alt={room.title}
          className="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
        />
        <div className="absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors duration-300" />
      </div>
      <div className="px-1">
        <h3 className="text-[#333333] font-medium text-sm">{room.title}</h3>
        <p className="text-[#707070] text-xs mt-1">{categoryLabel}</p>
      </div>
    </button>
  );
}