import type { DateRange, IconName, LinkButton, Photo, Section } from '../shared';

interface Screenshot {
  /**
   * [WEB] Source of the screenshot.
   */
  src: Photo;

  /**
   * [WEB] Alt text for the screenshot.
   */
  alt: string;
}

export interface Membership {
  /**
   * Name of the organization or association you are / were a member of.
   */
  organization: string;

  /**
   * [WEB] Logo of the organization.
   *
   * **Ratio**: 1:1
   *
   * **Display size**: 56x56px
   */
  image?: Photo;

  /**
   * Date range of your membership.
   *
   * If the second date is `null`, the membership is ongoing.
   */
  dates: DateRange;

  /**
   * A short description of the organization or your role. You can use markdown syntax.
   */
  description: string;

  /**
   * [WEB] Links related to the membership (e.g. organization website).
   */
  links: LinkButton[];

  /**
   * [WEB] Screenshots related to the membership (e.g. certificate, badge).
   */
  screenshots?: Screenshot[];
}

export interface MembershipSection extends Section {
  config: Section['config'] & {
    /**
     * [WEB] Configuration of the button that displays membership screenshots.
     */
    screenshots?: {
      /**
       * [WEB] Icon displayed within the button.
       */
      icon?: IconName;

      /**
       * [WEB] Title displayed when hovering the button.
       */
      title?: string;
    };
  };

  /**
   * List of your memberships. Start with the most recent one.
   */
  memberships: Membership[];
}
