dify/web/app/components/datasets/create-from-pipeline/list/customized-list.tsx
Stephen Zhou 6d0e36479b
refactor(i18n): use JSON with flattened key and namespace (#30114)
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-29 14:52:32 +08:00

30 lines
908 B
TypeScript

import { useTranslation } from 'react-i18next'
import { usePipelineTemplateList } from '@/service/use-pipeline'
import TemplateCard from './template-card'
const CustomizedList = () => {
const { t } = useTranslation()
const { data: pipelineList, isLoading } = usePipelineTemplateList({ type: 'customized' })
const list = pipelineList?.pipeline_templates || []
if (isLoading || list.length === 0)
return null
return (
<>
<div className="system-sm-semibold-uppercase pt-2 text-text-tertiary">{t('templates.customized', { ns: 'datasetPipeline' })}</div>
<div className="grid grid-cols-1 gap-3 py-2 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4">
{list.map((pipeline, index) => (
<TemplateCard
key={index}
type="customized"
pipeline={pipeline}
/>
))}
</div>
</>
)
}
export default CustomizedList