'use client'

import { useRouter } from 'next/navigation'

export default function InquiryItems({ inquiryData }: { inquiryData: any }) {
  const router = useRouter()
  return (
    <div>
      {inquiryData.map((item: any) => (
        <div key={item.id} onClick={() => router.push(`/inquiry/${item.id}`)}>
          <div>{item.title}</div>
          <div>{item.content}</div>
          <div>{item.createdAt}</div>
          <div>{item.writer}</div>
          <div>{item.category}</div>
          {item.file && <div>{item.file}</div>}
        </div>
      ))}
    </div>
  )
}
