import * as React from 'react';
import type { Meta } from '@storybook/react';
import { ActionButton as Component, ActionButtonProps as Props } from '.';
import { Button } from '@tesseract-design/web-base';

const meta: Meta<typeof Component> = {
	component: Component,
	argTypes: {
		type: {
			control: { type: 'select' },
			options: Button.AVAILABLE_TYPES,
		},
		variant: {
			control: { type: 'select' },
			options: Button.AVAILABLE_VARIANTS,
		},
		size: {
			control: { type: 'select' },
			options: Button.AVAILABLE_SIZES,
		},
		subtext: {
			control: { type: 'text' },
		},
		badge: {
			control: { type: 'text' },
		},
		icon: {
			control: { type: 'text' },
		},
		children: {
			control: { type: 'text' },
		},
		onClick: {
			table: {
				disable: true,
			},
			action: 'clicked',
		},
	},
	args: {
		...(Component.defaultProps ?? {}),
		subtext: 'Subtext',
		badge: '1',
		children: Component.displayName,
	},
};

export const ActionButton = (args: Omit<Props, 'ref'>) => (
	<Component
		{...args}
	/>
);

export default meta;
