import React from 'react';

import MessageText from './MessageText';
import MessageTool from './MessageTool';
import type { DebugTranscriptRow } from './types';

const TranscriptItem: React.FC<{
  row: DebugTranscriptRow;
}> = ({ row }) => {
  if (row.kind === 'tool') {
    return <MessageTool row={row} />;
  }

  return <MessageText row={row} />;
};

export default React.memo(TranscriptItem);

