import { Meta, Story, Preview} from "@storybook/addon-docs/blocks"
import SGmail from "../SGmail"

<Meta title='Share/SGmail' component={ SGmail } />

<style>{`
  .custom-preview .base-canvas {
    height: auto;
  }
`}</style>

# SGmail

## Preview

<Preview className="custom-preview">
  <Story id='share-sgmail--default' />
</Preview>

## Example

```html
<template>
  <s-gmail
    :window-features="windowFeatures"
    :share-options="shareOptions"
    :use-native-behavior="useNativeBehavior"
    @popup-close="onClose"
    @popup-open="onOpen"
    @popup-block="onBlock"
    @popup-focus="onFocus"
  ></s-gmail>
</template>

<script>
  import { SGmail } from 'vue-socials'

  export default {
    name: 'SGmailSharing',

    components: { SGmail },

    data() {
      return {
        windowFeatures: {},
        shareOptions: {
          to: 'google@gmail.com',
          su: 'Title',
          cc: 'google1@gmail.com',
          bcc: 'google2@gmail.com',
          body: 'Hello\nWorld',
        },
        useNativeBehavior: false,
      }
    },

    methods: {
      onClose() {},
      onOpen() {},
      onBlock() {},
      onFocus() {},
    }
  };
</script>
```

## Props

| Prop | Type | Description | Default value |
| ------ | ------ | ------ | ------ |
`windowFeatures` | `object` | Pass options to `window.open()`. [Requested features of the new window.](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#window_features) | `{ width: 600, height: 540, }`
`shareOptions` | `object` | Your share link parameters: <br /> **to** – e-mail recipient address <br /> **su** – subject of e-mail <br /> **cc** – carbon copy e-mail address <br />  **bcc** – blind carbon copy e-mail address <br />  **body** – body of e-mail <br /> | `{}`
`useNativeBehavior` | `boolean` | Use native link behavior instead of `window.open()` or not | `false`
