import { h, Component } from 'preact'

import FileLink from '../../containers/fileLink.js'

export default function TaskListView (props) {
  const tasks = (props.tasks || []).map( (task, i) => {
    return (
      <div key={i}>
        <span>{task.id}</span>
        <span>{task.created_at}</span>
        <span class='name'><FileLink file={task.content_file} /></span>
        <span class='name'><FileLink file={task.style_file} /></span>
        <span>α={task.alpha}</span>
        <span class='name'><FileLink file={task.output_file} /></span>
      </div>
    )
        // <span class='name'>{task.result_file.name}</span>
  })
  return (
    <div class='list'>
      {tasks}
    </div>
  )
}
