import { Box } from "@mui/material";
import React from "react";
import Body from "./contacts-components/Body";

import ContactInfo from "./ContactInfo";
import Sidebar from "./contacts-components/Sidebar";

interface Props {
  setMeetingInfoOpen: (open: boolean) => void;
}

const Contacts: React.FC<Props> = (props) => {
  const [contactSelected, setContactSelected] =
    React.useState<ContactInfo | null>(null);

  return (
    <Box sx={{ display: "flex", height: "100%" }}>
      <Sidebar setContactSelected={setContactSelected} />
      {contactSelected !== null ? (
        <Body
          contactSelected={contactSelected}
          setMeetingInfoOpen={props.setMeetingInfoOpen}
        />
      ) : null}
    </Box>
  );
};

export default Contacts;
