page.openStatus(room)}
/>
),
}
: column,
),
{
key: "actions",
label: "操作",
width: "minmax(104px, 0.6fr)",
render: (room) => ,
},
];
return (
room.roomId}
/>
{total > 0 ? (
) : null}
page.setForm({ ...page.form, title: event.target.value })}
/>
page.setForm({ ...page.form, coverUrl })}
/>
page.setForm({ ...page.form, visibleRegionId })}
/>
page.setForm({ ...page.form, description: event.target.value })}
/>
page.setStatusForm({ status: event.target.value })}
>
);
}
function RoomIdentity({ onClick, room }) {
const content = (
{room.coverUrl ?
: }
{room.title || "-"}
{room.roomId}
);
if (!onClick) {
return content;
}
return (
);
}
function OwnerIdentity({ room }) {
const owner = room.owner || {};
const ownerName = owner.username || "-";
const ownerDisplayId = owner.displayUserId || room.ownerUserId || "-";
return (
{owner.avatar ?
: }
{ownerName}
{ownerDisplayId}
);
}
function RoomActions({ page, room }) {
return (
{page.abilities.canUpdate ? (
page.openEdit(room)}>
) : null}
{page.abilities.canDelete ? (
page.removeRoom(room)}
>
) : null}
);
}
function RoomStatus({ disabled, onClick, status }) {
const normalizedStatus = status === "active" ? "active" : "closed";
const tone = normalizedStatus === "active" ? "running" : "stopped";
const badge = (
{roomStatusLabels[normalizedStatus]}
);
if (disabled) {
return badge;
}
return (
);
}
function ActionModal({ children, disabled, loading, onClose, onSubmit, open, title }) {
return (
{children}
);
}
function formatNumber(value) {
return Number(value || 0).toLocaleString("zh-CN");
}