推荐问题配置
管理首页展示的推荐问题,点击后直接发送到对话。拖拽可调整顺序。
{!isLoading && !error && questions.length > 0 && (
)}
{isLoading ? (
) : error ? (
) : questions.length === 0 ? (
) : visibleQuestions.length === 0 ? (
) : (
{visibleQuestions.map((q, index) => (
!isFiltering && handleDragStart(index)}
onDragOver={(e) => !isFiltering && handleDragOver(e, index)}
onDrop={() => !isFiltering && handleDrop(index)}
onDragEnd={() => {
setDragIndex(null);
setDragOverIndex(null);
}}
className={`flex items-start gap-3 rounded-xl border bg-white px-4 py-3.5 transition-colors dark:bg-[#022248] dark:!border-[#213D5E] ${
dragOverIndex === index && dragIndex !== index
? "border-blue-400 bg-blue-50 dark:border-[#2580FF] dark:bg-[#0D2D54]"
: "border-[#e4e4e7]"
}`}
>
{q.title}
{q.content}
{(q.tags?.length ?? 0) > 0 && (
)}
))}
)}
{/* 添加 / 编辑弹窗 */}
{/* 打标签弹窗(按岗位分发推荐问题) */}
{tagTarget && (
!o && setTagTarget(null)}
targetType="recommended_question"
targetId={tagTarget.id}
title={`为「${tagTarget.title}」打标签`}
/>
)}
{/* 删除确认弹窗 */}
);
}