您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

coop.tsx 660B

123456789101112131415161718192021222324252627
  1. import Cursor from './cursor'
  2. import { useCoopSelector } from 'state/coop/coop-state'
  3. export default function Presence(): JSX.Element {
  4. const others = useCoopSelector((s) => s.data.others)
  5. return (
  6. <>
  7. {Object.values(others).map(({ connectionId, presence }) => {
  8. if (presence == null) {
  9. return null
  10. }
  11. return (
  12. <Cursor
  13. key={`cursor-${connectionId}`}
  14. color={'red'}
  15. duration={presence.duration}
  16. times={presence.times}
  17. bufferedXs={presence.bufferedXs}
  18. bufferedYs={presence.bufferedYs}
  19. />
  20. )
  21. })}
  22. </>
  23. )
  24. }