import React from "react";
import { Meta, Story } from "@storybook/react";
import { AtomLink, ILinkProps } from "native/atoms/Link";

const meta: Meta = {
  title: "React Native/atoms/Link",
  component: AtomLink,
  argTypes: {
    openLink: {
      table: {
        disable: true,
      },
    },
  },
  parameters: {
    controls: { expanded: true },
  },
};

export default meta;

const TemplateLink: Story<ILinkProps> = (props) => <AtomLink {...props} />;

export const Link = TemplateLink.bind({});

Link.args = {
  url: "http://localhost:6006/",
  typeIcon: "noIcon",
  text: "Link",
  typeLink: "default",
  color: "primary",
  customColor: "neutral",
  align: "left",
  nameIconLeft: "cancel",
  nameIconRight: "keyboard_arrow_right",
  disabled: false,
  styles: {},
};

const TemplateInternalLink: Story<ILinkProps> = (props) => (
  <AtomLink {...props} />
);

export const InternalLink = TemplateInternalLink.bind({});

InternalLink.args = {
  url: "http://localhost:6006/",
  typeIcon: "noIcon",
  text: "Link with a function for screen redirection",
  typeLink: "default",
  color: "primary",
  customColor: "neutral",
  align: "left",
  nameIconLeft: "cancel",
  nameIconRight: "keyboard_arrow_right",
  disabled: false,
  styles: {},
  openLink: () => {
    alert("This is a function for screen redirection");
  },
};
