File size: 558 Bytes
82d85df
 
 
 
 
 
 
 
 
dbc8f44
82d85df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"use client"

import { ReactNode } from "react"

import { cn } from "@/lib/utils"
import { useStore } from "@/app/store"

export function Grid({ children, className }: { children: ReactNode; className: string }) {
  const zoomLevel = useStore(state => state.zoomLevel)

  return (
    <div
      // the "fixed" width ensure our comic keeps a consistent ratio
      className={cn(
        `w-full h-full grid`,
        className
      )}
      style={{
        gap: `${Math.round((zoomLevel / 100) * 8)}px`
      }}
      >
      {children}
    </div>
  )
}