import React from 'react';
import { AtomTruncate, ITruncateProps } from 'react/atoms/Typography/Truncate';
import { Meta, Story } from '@storybook/react';
import { theme } from 'data/dataMx';

const meta: Meta = {
  title: 'React/atoms/Typography/Truncate',
  component: AtomTruncate,
  argTypes: {
    align: {
      table: {
        disable: true,
      }
    },
    color: {
      control: {
        type: 'select'
      },
      options: theme,
    }
  },
  parameters: {
    controls: { expanded: true },
  },
};

export default meta;

const TemplateTruncate: Story<ITruncateProps> = (props) => <AtomTruncate {...props} />;

// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
// https://storybook.js.org/docs/react/workflows/unit-testing
export const Truncate = TemplateTruncate.bind({});

Truncate.args = {
  size: 'large',
  text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras auctor euismod ex quis porta. Sed ut tortor turpis. Vivamus in ligula non massa efficitur laoreet ut ut turpis.',
  color: 'neutral700',
  weight: 'regular',
  numberOfLineTruncate: 1,
  styles: {}
};
