代码修改
This commit is contained in:
1 parent
de597b602a
commit
1a122eb7fd
20 files changed
+812
-140
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { useState } from 'react';
|
||||
import { ChevronRight, ExternalLink } from 'lucide-react';
|
||||
import { ChevronRight, ExternalLink, Sparkles } from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { buildIntranetSourceUrl } from '@/core/config';
|
||||
import type { AIMaterial } from '../../types/ai-writing';
|
||||
@@ -26,12 +26,14 @@ function relevanceLabel(score: number): string {
|
||||
export function MaterialItem({ material, checked, onToggle }: MaterialItemProps) {
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
const pct = Math.round(material.relevanceScore * 100);
|
||||
const isSkill = material.sourceType === 'skill';
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
'rounded-md border text-xs transition-colors',
|
||||
checked ? 'border-border bg-background' : 'border-border/50 bg-muted/30',
|
||||
isSkill && checked && 'border-violet-300/70 dark:border-violet-800/60',
|
||||
)}
|
||||
>
|
||||
{/* 头部行 */}
|
||||
@@ -50,6 +52,12 @@ export function MaterialItem({ material, checked, onToggle }: MaterialItemProps)
|
||||
onClick={() => setExpanded((v) => !v)}
|
||||
className="flex flex-1 items-start gap-1.5 text-left"
|
||||
>
|
||||
{isSkill && (
|
||||
<span className="mt-0.5 inline-flex items-center gap-0.5 px-1 py-0.5 rounded text-[10px] font-medium bg-violet-100 text-violet-700 dark:bg-violet-900/60 dark:text-violet-200 shrink-0">
|
||||
<Sparkles className="size-2.5" />
|
||||
技能
|
||||
</span>
|
||||
)}
|
||||
<span className={cn('flex-1 font-medium leading-snug line-clamp-2', !checked && 'text-muted-foreground')}>
|
||||
{material.title}
|
||||
</span>
|
||||
|
||||
Reference in new issue
Block a user