CoolFace
Apppublic

bbbing/bingo

sourceHugging Facemitupdated 3y agoView on Hugging Face
0likes
learn-more.tsx40 linesDownload Raw Back to components
1import React from 'react'2import { SourceAttribution } from '@/lib/bots/bing/types'3 4export interface LearnMoreProps {5  sourceAttributions?: SourceAttribution[]6}7 8export function LearnMore({ sourceAttributions }: LearnMoreProps) {9  if (!sourceAttributions?.length) {10    return null11  }12 13  return (14    <div className="learn-more-root" role="list" aria-label="了解详细信息:">15      <div className="learn-more">了解详细信息:</div>16      <div className="attribution-container">17        <div className="attribution-items">18          {sourceAttributions.map((attribution, index) => {19            const { providerDisplayName, seeMoreUrl } = attribution20            const { host } = new URL(seeMoreUrl)21            return (22              <a23                key={index}24                className="attribution-item"25                target="_blank"26                role="listitem"27                href={seeMoreUrl}28                title={providerDisplayName}29                tabIndex={index}30              >31                {index + 1}. {host}32              </a>33            )34          })}35        </div>36      </div>37    </div>38  )39}40