import type { Meta } from '@storybook/react'

import {
  Template,
  type TemplateProps,
} from '../../stories/customMessageStoryTemplate'
import {
  currentUserArgType,
  storyUsers,
} from '../../stories/decorators/storyUser'

const meta: Meta = {
  title: 'CustomMessage/Tip Message',
  argTypes: currentUserArgType,
  args: { currentUser: storyUsers.creator },
  parameters: {
    layout: 'fullscreen',
  },
}
export default meta

// Figma "Tip with message" (node 2353:14548): a sent tip pill stacked
// directly above its accompanying text bubble, tail + delivery status below.
export const TipWithMessage = Template.bind({})
TipWithMessage.args = {
  messages: [
    {
      id: 'msg-1',
      text: 'Thanks you so much!',
      user: storyUsers.creator,
      metadata: { custom_type: 'MESSAGE_TIP', amount_text: '$1' },
    },
  ],
} satisfies TemplateProps

// Same "Tip with message" layout, but textless — only the tip pill renders,
// no second bubble.
export const TipWithoutMessage = Template.bind({})
TipWithoutMessage.args = {
  messages: [
    {
      id: 'msg-1',
      text: '',
      user: storyUsers.creator,
      metadata: { custom_type: 'MESSAGE_TIP', amount_text: '$1' },
    },
  ],
} satisfies TemplateProps
