-1
items.map(item => {
  return(
    <tr key={item.id}>
      <td>{item.id}</td>
      <td>{item.heading}</td>
      <td style={{width:"7.5%"}}>
        <img className="bar-sm"src={item.image} alt="pic error" style=
{{width:'70px',height:'35px'}}/>
      </td>
      <td>
        if (item.status === 0) {
          return (
            <>
              <button type="button" className="btn btn-sm btn-secondary btn-toggle"  data-toggle="button" aria-pressed="false" autocomplete="off"onClick={() =>Switch(item.status,item.id)}>
                <div className="handle"></div>
              </button>
            </>
          )
        }
      </td>
      <td>{item.slug}</td>
      <td>{item.category.name}</td>
Felix Kling
  • 795,719
  • 175
  • 1,089
  • 1,143
vim kndll
  • 19
  • 1
  • 6

1 Answers1

0

Try using this kind of sintax "? :" for the conditional instead of if/else