import React from 'react'; import { makeStyles } from '@material-ui/core/styles'; import { BugFragment } from './Bug.generated'; import LabelChange from './LabelChange'; import Message from './Message'; import SetStatus from './SetStatus'; import SetTitle from './SetTitle'; import { TimelineItemFragment } from './TimelineQuery.generated'; const useStyles = makeStyles((theme) => ({ main: { '& > *:not(:last-child)': { marginBottom: theme.spacing(2), }, }, })); type Props = { ops: Array; bug: BugFragment; }; function Timeline({ bug, ops }: Props) { const classes = useStyles(); return (
{ops.map((op, index) => { switch (op.__typename) { case 'CreateTimelineItem': return ; case 'AddCommentTimelineItem': return ; case 'LabelChangeTimelineItem': return ; case 'SetTitleTimelineItem': return ; case 'SetStatusTimelineItem': return ; } console.warn('unsupported operation type ' + op.__typename); return null; })}
); } export default Timeline;