import { type Meta, type StoryObj } from '@storybook/react-vite';

import { type BaseDatum } from './types';
import ScaleQuestionChart from '.';

const meta: Meta<typeof ScaleQuestionChart> = {
  component: ScaleQuestionChart,
  title: 'Composed Components/PeopleExperience/ScaleQuestionChart',
  tags: ['autodocs'],
  args: {
    data: [
      { label: 'Positive', value: 70, type: 'POSITIVE' },
      { label: 'Neutral', value: 20, type: 'NEUTRAL' },
      { label: 'Negative', value: 10, type: 'NEGATIVE' },
    ],
    onSelectItem: (item: BaseDatum | null) => {
      // eslint-disable-next-line no-console
      console.log('Selected item:', item);
    },
    helperText: 'This is a helper text',
    noDataText: 'No data available',
  },
};

export default meta;

type Story = StoryObj<typeof ScaleQuestionChart>;

export const Default: Story = {};

export const EmptyResults: Story = {
  args: {
    data: undefined,
  },
};
