import React from 'react';
import { Markdown } from 'react-benzin';
import { useEventLogs } from '../../hooks/APIClient';

interface PropTypes {
  eventId: string;
}


const Logs: React.FC<PropTypes> = ({ eventId }) => {
  const { data: logs } = useEventLogs(eventId);
  const logString = '```\n' + logs?.map(log => log.message).join('\n') + '\n```';

  return <Markdown data={logString} />;
};

export default Logs;
