import { graphql } from "@/gql";
import { type ContactListBlockFragment } from "@/gql/graphql";
import styles from "./contactListBlock.module.scss";
import { Blocks } from "./Blocks";

const ContactListBlockFragmentDefinition = graphql(`
  fragment ContactListBlock on ContactListBlock {
    items {
      blockType
      ... on ContactEntityBlock {
        contactEntity {
          ...ContactEntity
        }
      }
    }
  }
`);

export const ContactListBlock = ({
  block,
}: {
  block: ContactListBlockFragment;
}) => {
  return (
    <ul className={styles.contactList}>
      <Blocks blocks={block.items} />
    </ul>
  );
};
