import { useState } from "react"; import { useConsole } from "../context"; import { Card, Bar, DataListRaw } from "../components/ui"; import { ROLES } from "../api/types"; // Right-panel context for the Projects view. Previously embedded in the // projects card; moved here so the centre stays the project list/create // and the right stays the people for the selected project. export default function MembersPanel() { const ctx = useConsole(); const [inviteUser, setInviteUser] = useState(""); const [inviteRole, setInviteRole] = useState("contributor"); const proj = ctx.projects.find((p) => p.id === ctx.projectId); return ( {proj ?
{proj.name} | {proj.id} | 仓库 {proj.repo_url || "未绑定"} | 我的角色 {proj.my_role || "未知"}
:
先选项目
} setInviteUser(e.target.value)} /> {ctx.memberError ?
{ctx.memberError}
: ctx.members.length === 0 ?
先选项目
: ( {ctx.members.map((m) => { const label = (m.username || "") + (m.username ? "(" + String(m.user_id).slice(0, 8) + ")" : String(m.user_id).slice(0, 8)); return (
  • {label}
  • ); })}
    )} {ctx.memberMsg}
    ); }