index.js 806 B

1234567891011121314151617181920212223242526272829
  1. import React from "react"
  2. import AddParticipant from "./add-participant"
  3. import CardsList from "./cards-list"
  4. import * as utils from "./utils"
  5. export default function(props) {
  6. if (!props.participants.length) return null
  7. return (
  8. <div className="panel panel-default panel-participants">
  9. <div className="panel-body">
  10. <CardsList
  11. userIsOwner={getUserIsOwner(props.user, props.participants)}
  12. {...props}
  13. />
  14. <div className="row">
  15. <AddParticipant thread={props.thread} />
  16. <div className="col-xs-12 col-sm-9">
  17. <p>{utils.getParticipantsCopy(props.participants)}</p>
  18. </div>
  19. </div>
  20. </div>
  21. </div>
  22. )
  23. }
  24. export function getUserIsOwner(user, participants) {
  25. return participants[0].id === user.id
  26. }