import React from 'react';

export default function MemberList({ members }) {
  if (!members?.length) return <div style={{ color:'var(--muted)' }}>No members yet.</div>;
  return (
    <div className="member-list">
      {members.map(m => (
        <div key={m.id} className="member">
          <div className="avatar" />
          <div style={{ flex:1, minWidth:0 }}>
            <div style={{ fontWeight:700, overflow:'hidden', textOverflow:'ellipsis', whiteSpace:'nowrap' }}>{m.name}</div>
            <div style={{ fontSize:12, color:'var(--muted)' }}>{m.id.slice(0,8)}</div>
          </div>
          {m.isHost && <div className="tag">Host</div>}
        </div>
      ))}
    </div>
  );
}
