import CButtonGroup from "../components/CButtonGroup/CButtonGroup.vue";
import "./utils.css";

export default {
  title: "CButtonGroup",
  component: CButtonGroup,
  argTypes: {
    buttonObject: { control: { type: "object" } },
  },
};

const Template = (args, { argTypes }) => ({
  props: Object.keys(argTypes),
  components: { CButtonGroup },
  template: '<c-button-group v-bind="$props" />',
});

const consoleIt = () => {
  console.log("onclick fired")
}

const consoleOut = () => {
  console.log("focus lost")
}

export const Default = Template.bind({});
Default.args = {
  buttonObject: [
    {
      icon: 'chevron-left',
      value: 'previous',
      onClickAction: consoleIt,
    },
    { icon: "bookmark", label: "Students", value:'students', onClickAction: consoleIt, blurAction: consoleOut },
    { icon: "chat", label: "Alkama", value:'alkama'},
    { icon: "bookmark", label: "Attendance", value:'attendance' },
    {
      icon: 'chevron-right',
      value: 'next',
      onClickAction: consoleIt,
    },
  ],
};
