mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-23 06:46:40 +08:00
### What problem does this PR solve? Feat: Modify the style of the agent page bright theme #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,5 +1,17 @@
|
||||
import { ReactComponent as ArxivIcon } from '@/assets/svg/arxiv.svg';
|
||||
import { ReactComponent as BingIcon } from '@/assets/svg/bing.svg';
|
||||
import { ReactComponent as CrawlerIcon } from '@/assets/svg/crawler.svg';
|
||||
import { ReactComponent as DuckIcon } from '@/assets/svg/duck.svg';
|
||||
import { ReactComponent as GithubIcon } from '@/assets/svg/github.svg';
|
||||
import { ReactComponent as GoogleScholarIcon } from '@/assets/svg/google-scholar.svg';
|
||||
import { ReactComponent as GoogleIcon } from '@/assets/svg/google.svg';
|
||||
import { ReactComponent as PubMedIcon } from '@/assets/svg/pubmed.svg';
|
||||
import { ReactComponent as TavilyIcon } from '@/assets/svg/tavily.svg';
|
||||
import { ReactComponent as WenCaiIcon } from '@/assets/svg/wencai.svg';
|
||||
import { ReactComponent as WikipediaIcon } from '@/assets/svg/wikipedia.svg';
|
||||
import { ReactComponent as YahooFinanceIcon } from '@/assets/svg/yahoo-finance.svg';
|
||||
|
||||
import { IconFont } from '@/components/icon-font';
|
||||
import SvgIcon from '@/components/svg-icon';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { HousePlus } from 'lucide-react';
|
||||
import { Operator } from './constant';
|
||||
@ -27,19 +39,19 @@ export const OperatorIconMap = {
|
||||
};
|
||||
|
||||
const SVGIconMap = {
|
||||
[Operator.ArXiv]: 'arxiv',
|
||||
[Operator.GitHub]: 'github',
|
||||
[Operator.Bing]: 'bing',
|
||||
[Operator.DuckDuckGo]: 'duck',
|
||||
[Operator.Google]: 'google',
|
||||
[Operator.GoogleScholar]: 'google-scholar',
|
||||
[Operator.PubMed]: 'pubmed',
|
||||
[Operator.TavilyExtract]: 'tavily',
|
||||
[Operator.TavilySearch]: 'tavily',
|
||||
[Operator.Wikipedia]: 'wikipedia',
|
||||
[Operator.YahooFinance]: 'yahoo-finance',
|
||||
[Operator.WenCai]: 'wencai',
|
||||
[Operator.Crawler]: 'crawler',
|
||||
[Operator.ArXiv]: ArxivIcon,
|
||||
[Operator.GitHub]: GithubIcon,
|
||||
[Operator.Bing]: BingIcon,
|
||||
[Operator.DuckDuckGo]: DuckIcon,
|
||||
[Operator.Google]: GoogleIcon,
|
||||
[Operator.GoogleScholar]: GoogleScholarIcon,
|
||||
[Operator.PubMed]: PubMedIcon,
|
||||
[Operator.TavilyExtract]: TavilyIcon,
|
||||
[Operator.TavilySearch]: TavilyIcon,
|
||||
[Operator.Wikipedia]: WikipediaIcon,
|
||||
[Operator.YahooFinance]: YahooFinanceIcon,
|
||||
[Operator.WenCai]: WenCaiIcon,
|
||||
[Operator.Crawler]: CrawlerIcon,
|
||||
};
|
||||
|
||||
const Empty = () => {
|
||||
@ -48,6 +60,7 @@ const Empty = () => {
|
||||
|
||||
const OperatorIcon = ({ name, className }: IProps) => {
|
||||
const Icon = OperatorIconMap[name as keyof typeof OperatorIconMap] || Empty;
|
||||
const SvgIcon = SVGIconMap[name as keyof typeof SVGIconMap] || Empty;
|
||||
|
||||
if (name === Operator.Begin) {
|
||||
return (
|
||||
@ -57,20 +70,10 @@ const OperatorIcon = ({ name, className }: IProps) => {
|
||||
);
|
||||
}
|
||||
|
||||
if (name in SVGIconMap) {
|
||||
return (
|
||||
<SvgIcon
|
||||
name={SVGIconMap[name as keyof typeof SVGIconMap]}
|
||||
width={20}
|
||||
className={className}
|
||||
></SvgIcon>
|
||||
);
|
||||
}
|
||||
|
||||
return typeof Icon === 'string' ? (
|
||||
<IconFont name={Icon} className={cn('size-5', className)}></IconFont>
|
||||
) : (
|
||||
<Icon width={20} className={cn('size-5 fill-current', className)}></Icon>
|
||||
<SvgIcon className={cn('size-5 fill-current', className)}></SvgIcon>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user