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

import { DrawerLayerProvider } from '../../../layers/Drawers';

import ProfileSingleFieldRow from '.';

const meta: Meta<typeof ProfileSingleFieldRow> = {
  component: ProfileSingleFieldRow,
  title: 'Composed Components/Profile/ProfileSingleFieldRow',
  tags: ['autodocs'],
  decorators: [
    Story => (
      <DrawerLayerProvider>
        <Story />
      </DrawerLayerProvider>
    ),
  ],
  args: {
    field: {
      name: 'Full name',
      value: 'John Doe',
    },
    texts: {
      items_associated_to_field: 'Items associated to this field',
      no_items_found: 'No items found',
      back: 'Back',
      items_total: '1 item total',
    },
  },
};

export default meta;

type Story = StoryObj<typeof ProfileSingleFieldRow>;

export const Default: Story = {
  args: {},
};

export const LongValue: Story = {
  args: {
    field: {
      name: 'Address',
      value:
        '1234 Elm Street, Springfield, Illinois, 62704, United States of America',
    },
  },
};

export const ShortValue: Story = {
  args: {
    field: {
      name: 'Age',
      value: '28',
    },
  },
};
