import React, { ReactNode } from "react";
import { Image } from "./Image";
import styles from "./TechTalkCard.module.css";

interface TechTalkProps {
  name: string;
  poster?: string;
  children: ReactNode;
}

export function TechTalkCard({ name, poster, children }: TechTalkProps) {
  return (
    <article className={styles.card}>
      <aside>
        {poster && <Image alt={name} src={poster} />}
        {!poster && <div className={styles.spacer}></div>}
      </aside>
      <section className={styles.content}>
        <h1>{name}</h1>
        <div>{children}</div>
      </section>
    </article>
  );
}
