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/Paid Message',
  argTypes: currentUserArgType,
  args: { currentUser: storyUsers.creator },
  parameters: {
    layout: 'fullscreen',
  },
}
export default meta

// A paid message keeps the original small "Delivered with $X message" tag
// (gift icon + green text) under the bubble — unlike a tip, it never gets
// the pill treatment.
export const Default = Template.bind({})
Default.args = {
  messages: [
    {
      id: 'msg-1',
      text: "Here's the private coaching link we discussed!",
      user: storyUsers.creator,
      metadata: { custom_type: 'MESSAGE_PAID', amount_text: '$10' },
    },
    // Trailing reply so the paid message is no longer the latest own
    // message — keeps the "✓✓ Delivered" stamp off this example.
    {
      id: 'msg-2',
      text: 'Thank you so much!',
      user: storyUsers.visitor,
    },
  ],
} satisfies TemplateProps
