import { Box } from '@mui/material'
import type { Inquiry } from '../../domain/inquiry'
import { InquiryListRow } from './InquiryListRow'

interface InquiryListProps {
  inquiries: Inquiry[]
  selectedId: string | null
  onSelect: (id: string) => void
}

export function InquiryList({ inquiries, selectedId, onSelect }: InquiryListProps) {
  return (
    <Box sx={{ overflowY: 'auto', flex: 1 }}>
      {inquiries.map(inq => (
        <InquiryListRow
          key={inq.id}
          inquiry={inq}
          selected={inq.id === selectedId}
          onClick={() => onSelect(inq.id)}
        />
      ))}
    </Box>
  )
}
