diff options
author | eug-vs <eug-vs@keemail.me> | 2020-11-29 16:26:00 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-11-29 16:26:00 +0300 |
commit | 3836f103ff40637e48c04eae9968b008e524294f (patch) | |
tree | adf73ec68b835ec6952f1d88671844302e2a44db /src/components/EventCard/Logs.tsx | |
parent | b91bbecb1be55b96f92eaca6f4bb8d33982b0834 (diff) | |
download | famcs-kit-3836f103ff40637e48c04eae9968b008e524294f.tar.gz |
feat: add Logs to EventCard
Diffstat (limited to 'src/components/EventCard/Logs.tsx')
-rw-r--r-- | src/components/EventCard/Logs.tsx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/components/EventCard/Logs.tsx b/src/components/EventCard/Logs.tsx new file mode 100644 index 0000000..f508c16 --- /dev/null +++ b/src/components/EventCard/Logs.tsx @@ -0,0 +1,17 @@ +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; |