File size: 937 Bytes
fd2aa6b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import { Game } from "@/app/games/types"
import { DraggableItem } from "./draggable-item"
import { OnInventoryEvent } from "@/types"
import { cn } from "@/lib/utils";

export function Inventory({
  className = "",
  game,
  isLoading,
  onEvent
}: {
  className?: string;
  game: Game;
  isLoading: boolean;
  onEvent: OnInventoryEvent;
}) {  
  return (
    <div className={cn(
      `fixed z-20 top-28 left-0 p-6 w-28`,
      // `w-full bg-stone-500 rounded-xl backdrop-blur-md bg-white/10`
      className,
    )}>
      <div className={cn(
        `flex flex-col space-y-2`
        //  `w-full grid grid-cols-6 sm:grid-cols-8 md:grid-cols-10 lg:grid-cols-12 gap-4`,
      )}>
        {game.inventory.map(item => (
          <DraggableItem
            key={item.name}
            game={game}
            item={item}
            isLoading={isLoading}
            onEvent={onEvent}
          />
        ))}
      </div>
    </div>
  )
}