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

<Meta title='Count/SHatenaCount' component={ SHatenaCount } />

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

# SHatenaCount

## Preview

<Preview className="custom-preview">
  <Story id='count-shatena--default' />
</Preview>

## Example

```html
<template>
  <s-hatena-count
    :share-options="shareOptions"
    @load="onLoad"
    @error="onError"
    @loading="onLoading"
  ></s-hatena-count>
</template>

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

  export default {
    name: 'SHatenaCountSharing',

    components: { SHatenaCount },

    data() {
      return {
        tag: 'span',
        shareOptions: {
          url: 'https://github.com/',
        },
      }
    },

    methods: {
      onLoad() {},
      onError() {},
      onLoading() {},
    }
  };
</script>
```

## Props

| Prop | Type | Description | Default value |
| ------ | ------ | ------ | ------ |
`shareOptions` | `object` | Your share link parameters: <br /> **url** – the URL you want to share <br /> | `{}`
`tag` | `string` | Dynamic HTML tag or component  | `span`

## Events

| Event name | Usage |
| ------ | ------ |
`load` |  the request has finished successfully |
`error` | the request has finished with error |
`loading` | the request has started |

## ⚠️ Warning

This component uses `JSONP` so the content won't be available during `SSR`.

