import {createTeaser} from "./TeaserComponent";

export default {
  title: 'Components/Teaser',
  args: {
    type: 'regular',
    kicker: 'Fachkräfte',
    headline: 'Anteil der Frauen im Bereich Engineering steigt',
    copy: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita, no sea takimata sanctus est.',
    imageSrc: 'https://source.unsplash.com/-uHVRvDr7pg/420x280',
    copyright: '@ shutterstock.com',
    showReadingTime: false,
    link: '#',
    imageSize: 'large',
    chartTitle: 'Chart-Titel des Teasers',
    linkType: null,
  },
  argTypes: {
    type: {
      name: 'Teaser-Typ',
      control: 'select',
      options: ['regular', 'hero', 'text', 'fullwidth', 'chart'],
    },
    link: {
      name: 'Link',
    },
    imageSrc: {
      name: 'Bild-Url',
    },
    copyright: {
      name: 'Copyright-Text',
    },
    kicker: {
      name: 'Dachzeile',
    },
    headline: {
      name: 'Überschrift',
    },
    copy: {
      name: 'Kurztext',
    },
    showReadingTime: {
      name: 'Lesezeit anzeigen',
    },
    imageSize: {
      name: 'Bildgröße',
      control: 'select',
      options: ['large', 'medium', 'small'],
    },
    chartTitle: {
      name: 'Chart Titel',
    },
    linkType: {
      name: 'Link Typ',
      control: 'select',
      options: ['extern', 'download', 'intranet', 'extranet'],
    }
  }
}

const Template = ({...args}) => {
  return createTeaser({...args});
};

export const RegularTeaser = Template.bind({});
RegularTeaser.args = {
  type: 'regular',
};

export const HeroTeaser = Template.bind({});
HeroTeaser.args = {
  type: 'hero',
};

export const TextTeaser = Template.bind({});
TextTeaser.args = {
  type: 'text',
};

export const ChartTeaser = Template.bind({});
ChartTeaser.args = {
  type: 'chart',
  imageSrc: null,
};

export const ExternalTeaser = Template.bind({});
ExternalTeaser.args = {
  linkType: 'extern',
};

export const FullwidthTeaserLarge = Template.bind({});
FullwidthTeaserLarge.args = {
  type: 'fullwidth',
  showReadingTime: true,
  imageSize: 'large',
};

export const FullwidthTeaserMedium = Template.bind({});
FullwidthTeaserMedium.args = {
  type: 'fullwidth',
  showReadingTime: true,
  imageSize: 'medium',
};

export const FullwidthTeaserSmall = Template.bind({});
FullwidthTeaserSmall.args = {
  type: 'fullwidth',
  showReadingTime: true,
  imageSize: 'small',
};


