import type { ListProps } from "@/types/requests/blocks/list"

import styles from "./list.module.css"
import ListItem from "./ListItem"

export default function List({ list }: ListProps) {
  return (
    <div>
      {list.title ? <h2 className={styles.title}>{list.title}</h2> : null}
      <ul className={styles.ul}>
        {list.list_items.map((item, i) => (
          <ListItem listItem={item} key={`list-item-${i}`} />
        ))}
      </ul>
    </div>
  )
}
