/* * Copyright 2025 coze-dev Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import React from 'react'; import { type IntelligenceData } from '@coze-arch/idl/intelligence_api'; import { I18n } from '@coze-arch/i18n'; import { Typography } from '@coze-arch/coze-design'; import { formatDate, getFormatDateType } from '@coze-arch/bot-utils'; import { highlightService } from '../services/use-case-services/highlight-text.service'; interface IntelligenceItemProps { intelligence: IntelligenceData; searchValue: string; onClick: () => void; } export const IntelligenceItem: React.FC = ({ intelligence, searchValue, onClick, }) => { const { basic_info } = intelligence; return (
{basic_info?.name}
{highlightService.highlightText( basic_info?.name || '', searchValue, )}
{basic_info?.description ? (
{highlightService.highlightText( basic_info?.description || '', searchValue, )}
) : null}
{I18n.t('bot_list_rank_tag_edited')}
{formatDate( Number(basic_info?.update_time), getFormatDateType(Number(basic_info?.update_time)), )}
); };