import { MarkCardI } from '@/lib/markcard/card'
import MarkCard from './MarkCard'
import React from 'react'

interface CardGridProps {
  cards: MarkCardI[]
  canEdit: boolean
  baseUrl: string
  onEdit?: (id: string, origin: MarkCardI) => void
}

export default function MarkCardGrid({ cards, onEdit, baseUrl, canEdit}: CardGridProps) {
  return (
    <div>
      {cards && <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
        {cards.map((card) => (
          <MarkCard
            key={card.id}
            card={card}
            baseUrl={baseUrl}
            canEdit={canEdit}
            onEdit={onEdit}
          />
        ))}
      </div>}
    </div>
  )
}
