import { ComponentStory, ComponentMeta } from '@storybook/react';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { MessageStatusEnum, MessageTypeEnum, RichTextContentSegment } from 'expo-schema';
import { block } from 'mock';
import { Message } from './index';

export default {
  title: 'Design System/Message',
  component: Message,
} as ComponentMeta<typeof Message>;

export const Interactive: ComponentStory<typeof Message> = (args) => {
  return (
    <SafeAreaProvider>
      <Message {...args} />
    </SafeAreaProvider>
  );
};

Interactive.args = {
  message: {
    id: '354',
    type: MessageTypeEnum.Text,
    status: MessageStatusEnum.Sent,
    richTextContent: block.richTextContent as unknown as RichTextContentSegment[],
    userName: {
      first: 'Muhammad ',
      last: 'Sarmad',
    },
    userProfilePhotoUrl: 'https://avatars.githubusercontent.com/u/98377997',
    createdAt: new Date(),
    modifiedAt: new Date(),
  },
};
