import React from "react";
import ItemUser from "./ItemUser";

function Replies({ data, update, setUpdate }) {
  return (
    <ul
      className={`flex pr-12 flex-col justify-center transition-all duration-500 overflow-hidden items-start gap-12 w-full
            ${data.is_open_reply ? "max-h-fit mt-12" : "max-h-0"}`}
    >
      {data.replies.map((item, idx) => (
        <ItemUser
          key={idx}
          data={item}
          isReply={true}
          update={update}
          setUpdate={setUpdate}
        />
      ))}
    </ul>
  );
}

export default Replies;
