import { withStyles } from '@material-ui/core/styles'
import TableCell from '@material-ui/core/TableCell/TableCell'
import TableRow from '@material-ui/core/TableRow/TableRow'
import Tooltip from '@material-ui/core/Tooltip/Tooltip'
import Typography from '@material-ui/core/Typography'
import ErrorOutline from '@material-ui/icons/ErrorOutline'
import gql from 'graphql-tag'
import React from 'react'
import { Link } from 'react-router-dom'
import * as moment from 'moment'
const Open = ({className}) =>
const Closed = ({className}) =>
const Status = ({status, className}) => {
switch(status) {
case 'OPEN': return
case 'CLOSED': return
default: return 'unknown status ' + status
}
}
const styles = theme => ({
cell: {
display: 'flex',
alignItems: 'center'
},
status: {
margin: 10
},
title: {
display: 'inline-block',
textDecoration: 'none'
},
labels: {
display: 'inline-block',
paddingLeft: theme.spacing.unit,
'&>span': {
padding: '0 4px',
margin: '0 1px',
backgroundColor: '#da9898',
borderRadius: '3px',
}
},
})
const BugSummary = ({bug, classes}) => (
{bug.title}
{bug.labels.map(l => (
{l})
)}
{bug.humanId} opened
{moment(bug.createdAt).fromNow()}
by {bug.author.name}
)
BugSummary.fragment = gql`
fragment BugSummary on Bug {
id
humanId
title
status
createdAt
labels
author {
name
}
}
`
export default withStyles(styles)(BugSummary)