Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

1.0 KB
Raw Blame
import { h } from "vue"

import { audioStatuses } from "#shared/constants/audio"

import VAudioControl from "~/components/VAudioTrack/VAudioControl.vue"

import type { Meta, StoryObj } from "@storybook/vue3"

const meta = {
  title: "Components/Audio track/Audio control",
  component: VAudioControl,

  argTypes: {
    status: {
      options: audioStatuses,
      control: "select",
    },

    size: {
      options: ["small", "medium", "large"],
      control: "select",
    },

    onToggle: { action: "toggle" },
  },
} satisfies Meta<typeof VAudioControl>

export default meta
type Story = StoryObj<typeof meta>

const Template: Omit<Story, "args"> = {
  render: (args) => ({
    components: { VAudioControl },
    setup() {
      return () => h(VAudioControl, args)
    },
  }),
}

export const Default = {
  ...Template,
  name: "Default",

  args: {
    status: "playing",
    size: "large",
  },
}

export const Disabled = {
  ...Template,
  name: "Disabled",

  args: {
    disabled: true,
    status: "playing",
    size: "medium",
  },
}