import React from "react";
import { StoryFn, StoryObj, Meta } from "@storybook/react";
import { SpokenLanguageCard, Root } from "../index";
import { SpokenLanguageCardProps } from "./types";

const defaultExport: Meta<typeof Root> = {
  title: "Unofficial/Demographics/SpokenLanguageCard",
  component: Root,
};

export default defaultExport;

const SpokenLanguageCardTemplate: StoryFn<typeof SpokenLanguageCard> = (
  args
) => (
  <Root>
    <SpokenLanguageCard {...args} />
  </Root>
);

export const Primary: StoryObj<SpokenLanguageCardProps> =
  SpokenLanguageCardTemplate.bind({});
Primary.args = {
  options: {
    labels: ["63% English", "24% French", "9% English and French", "4% Other"],
    data: [63, 24, 9, 4],
  },
};
