import type { UIMessage } from "ai"

export const UserMessage = (props:{message: UIMessage}) => {
  let message = props.message.parts.reduce((acc, part) => {
    if (part.type == 'text') {
      return acc + part.text
    }
    return acc
  },"");
  return (
    <div
      key={props.message.id}
      className='flex justify-end'
    >
      <div
        className=
        'max-w-[80%] px-4 py-2 text-sm space-y-2 bg-primary'
      >
      {message}
      </div>
    </div>
  )
}
