feat: add citation index to show (#7052)

This commit is contained in:
Wang Jiyuan 2025-06-10 19:42:30 +08:00 committed by GitHub
parent 3ee8186f96
commit e65091f83c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -139,6 +139,7 @@ const WebSearchCitation: React.FC<{ citation: Citation }> = ({ citation }) => {
<WebSearchCard> <WebSearchCard>
<ContextMenu> <ContextMenu>
<WebSearchCardHeader> <WebSearchCardHeader>
<CitationIndex>{citation.number}</CitationIndex>
{citation.showFavicon && citation.url && ( {citation.showFavicon && citation.url && (
<Favicon hostname={new URL(citation.url).hostname} alt={citation.title || citation.hostname || ''} /> <Favicon hostname={new URL(citation.url).hostname} alt={citation.title || citation.hostname || ''} />
)} )}
@ -162,6 +163,7 @@ const KnowledgeCitation: React.FC<{ citation: Citation }> = ({ citation }) => {
<WebSearchCard> <WebSearchCard>
<ContextMenu> <ContextMenu>
<WebSearchCardHeader> <WebSearchCardHeader>
<CitationIndex>{citation.number}</CitationIndex>
{citation.showFavicon && <FileSearch width={16} />} {citation.showFavicon && <FileSearch width={16} />}
<CitationLink className="text-nowrap" href={citation.url} onClick={(e) => handleLinkClick(citation.url, e)}> <CitationLink className="text-nowrap" href={citation.url} onClick={(e) => handleLinkClick(citation.url, e)}>
{citation.title} {citation.title}
@ -210,6 +212,13 @@ const PreviewIcon = styled.div`
} }
` `
const CitationIndex = styled.div`
font-size: 14px;
line-height: 1.6;
color: var(--color-text-2);
margin-right: 8px;
`
const CitationLink = styled.a` const CitationLink = styled.a`
font-size: 14px; font-size: 14px;
line-height: 1.6; line-height: 1.6;