import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
import { LineCopyButton } from '.';
import { useState } from 'react';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
var meta = {
  title: 'Components/LineCopyButton',
  tags: ['autodocs'],
  component: LineCopyButton,
  args: {
    styles: {
      display: 'flex'
    }
  },
  argTypes: {}
};
export var Doc = function Doc(props) {
  var styles = props.styles;
  var copyMsg = function copyMsg() {
    alert('click success!');
  };
  var _useState = useState(false),
    _useState2 = _slicedToArray(_useState, 2),
    hover = _useState2[0],
    setHover = _useState2[1];
  return /*#__PURE__*/_jsxs("div", {
    style: {
      display: 'flex',
      flexDirection: 'column',
      padding: 50,
      border: 'solid 0.5px #e5e7eb'
    },
    children: [/*#__PURE__*/_jsxs("div", {
      style: {
        width: 200,
        marginBottom: 50,
        padding: 20,
        display: 'flex',
        flexDirection: 'column',
        backgroundColor: 'aliceblue',
        position: 'relative'
      },
      onMouseEnter: function onMouseEnter() {
        return setHover(true);
      },
      onMouseLeave: function onMouseLeave() {
        return setHover(false);
      },
      children: ["Basic: Left", hover && /*#__PURE__*/_jsx(LineCopyButton, {
        onCopy: copyMsg
      })]
    }), /*#__PURE__*/_jsxs("div", {
      style: {
        width: 200,
        marginBottom: 50,
        padding: 20,
        display: 'flex',
        flexDirection: 'column',
        backgroundColor: 'aliceblue',
        position: 'relative'
      },
      onMouseEnter: function onMouseEnter() {
        return setHover(true);
      },
      onMouseLeave: function onMouseLeave() {
        return setHover(false);
      },
      children: ["Basic: Right:", hover && /*#__PURE__*/_jsx(LineCopyButton, {
        onCopy: copyMsg,
        direction: 'right'
      })]
    }), "Basic: Left", /*#__PURE__*/_jsx("div", {
      style: {
        width: 230,
        marginBottom: 50,
        display: 'flex',
        flexDirection: 'column',
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: 'antiquewhite',
        height: 128
      },
      onMouseEnter: function onMouseEnter() {
        return setHover(true);
      },
      onMouseLeave: function onMouseLeave() {
        return setHover(false);
      },
      children: /*#__PURE__*/_jsx("div", {
        style: {
          display: 'flex',
          flexDirection: 'row',
          justifyContent: 'space-between',
          alignItems: 'center',
          width: 200,
          position: 'relative',
          height: 64,
          background: 'aliceblue'
        },
        children: hover && /*#__PURE__*/_jsx(LineCopyButton, {
          onCopy: copyMsg
        })
      })
    }), "Basic: Right", /*#__PURE__*/_jsx("div", {
      style: {
        width: 230,
        marginBottom: 50,
        display: 'flex',
        flexDirection: 'column',
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: 'antiquewhite',
        height: 128
      },
      onMouseEnter: function onMouseEnter() {
        return setHover(true);
      },
      onMouseLeave: function onMouseLeave() {
        return setHover(false);
      },
      children: /*#__PURE__*/_jsx("div", {
        style: {
          display: 'flex',
          flexDirection: 'row',
          justifyContent: 'space-between',
          alignItems: 'center',
          width: 200,
          position: 'relative',
          height: 64,
          background: 'aliceblue'
        },
        children: hover && /*#__PURE__*/_jsx(LineCopyButton, {
          onCopy: copyMsg,
          direction: 'right'
        })
      })
    })]
  });
};
export default meta;