| import React from 'react' | import React from 'react' | ||||
| import { RiBookOpenLine } from '@remixicon/react' | |||||
| import { useTranslation } from 'react-i18next' | import { useTranslation } from 'react-i18next' | ||||
| import Input from '@/app/components/base/input' | import Input from '@/app/components/base/input' | ||||
| placeholder={t('dataset.externalKnowledgeDescriptionPlaceholder') ?? ''} | placeholder={t('dataset.externalKnowledgeDescriptionPlaceholder') ?? ''} | ||||
| className={`flex h-20 py-2 p-3 self-stretch items-start rounded-lg bg-components-input-bg-normal ${description ? 'text-components-input-text-filled' : 'text-components-input-text-placeholder'} system-sm-regular`} | className={`flex h-20 py-2 p-3 self-stretch items-start rounded-lg bg-components-input-bg-normal ${description ? 'text-components-input-text-filled' : 'text-components-input-text-placeholder'} system-sm-regular`} | ||||
| /> | /> | ||||
| <a | |||||
| className='flex py-0.5 gap-1 self-stretch' | |||||
| href='https://docs.dify.ai/features/datasets#how-to-write-a-good-dataset-description' | |||||
| target="_blank" | |||||
| rel="noopener noreferrer" | |||||
| > | |||||
| <div className='flex p-0.5 items-center gap-2'> | |||||
| <RiBookOpenLine className='w-3 h-3 text-text-tertiary' /> | |||||
| </div> | |||||
| <div className='flex-grow text-text-tertiary body-xs-regular'>{t('dataset.learnHowToWriteGoodKnowledgeDescription')}</div> | |||||
| </a> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </div> | </div> |
| import type { MouseEventHandler } from 'react' | import type { MouseEventHandler } from 'react' | ||||
| import { useState } from 'react' | import { useState } from 'react' | ||||
| import { RiCloseLine } from '@remixicon/react' | import { RiCloseLine } from '@remixicon/react' | ||||
| import { BookOpenIcon } from '@heroicons/react/24/outline' | |||||
| import { useContext } from 'use-context-selector' | import { useContext } from 'use-context-selector' | ||||
| import { useTranslation } from 'react-i18next' | import { useTranslation } from 'react-i18next' | ||||
| import cn from '@/utils/classnames' | import cn from '@/utils/classnames' | ||||
| className='block px-3 py-2 w-full h-[88px] rounded-lg bg-gray-100 text-sm outline-none appearance-none resize-none' | className='block px-3 py-2 w-full h-[88px] rounded-lg bg-gray-100 text-sm outline-none appearance-none resize-none' | ||||
| placeholder={t('datasetSettings.form.descPlaceholder') || ''} | placeholder={t('datasetSettings.form.descPlaceholder') || ''} | ||||
| /> | /> | ||||
| <a className='mt-2 flex items-center h-[18px] px-3 text-xs text-gray-500 hover:text-primary-600' href="https://docs.dify.ai/features/datasets#how-to-write-a-good-dataset-description" target='_blank' rel='noopener noreferrer'> | |||||
| <BookOpenIcon className='w-3 h-[18px] mr-1' /> | |||||
| {t('datasetSettings.form.descWrite')} | |||||
| </a> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </div> | </div> |
| import { useState } from 'react' | import { useState } from 'react' | ||||
| import { useMount } from 'ahooks' | import { useMount } from 'ahooks' | ||||
| import { useContext } from 'use-context-selector' | import { useContext } from 'use-context-selector' | ||||
| import { BookOpenIcon } from '@heroicons/react/24/outline' | |||||
| import { useTranslation } from 'react-i18next' | import { useTranslation } from 'react-i18next' | ||||
| import { useSWRConfig } from 'swr' | import { useSWRConfig } from 'swr' | ||||
| import { unstable_serialize } from 'swr/infinite' | import { unstable_serialize } from 'swr/infinite' | ||||
| value={description} | value={description} | ||||
| onChange={e => setDescription(e.target.value)} | onChange={e => setDescription(e.target.value)} | ||||
| /> | /> | ||||
| <a className='flex items-center h-[18px] px-3 text-xs text-gray-500' href="https://docs.dify.ai/features/datasets#how-to-write-a-good-dataset-description" target='_blank' rel='noopener noreferrer'> | |||||
| <BookOpenIcon className='w-3 h-[18px] mr-1' /> | |||||
| {t('datasetSettings.form.descWrite')} | |||||
| </a> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div className={rowClass}> | <div className={rowClass}> |