'use client' import type { ReactNode } from 'react' import { useTranslation } from 'react-i18next' import LearnDify from '@/app/components/explore/learn-dify' import FirstEmptyActionCard from './action-card' const EMPTY_PLACEHOLDER_CARD_IDS = Array.from({ length: 16 }, (_, index) => `placeholder-card-${index}`) type EmptyCreateAction = { id: string icon: ReactNode title: string description: string onClick: () => void } type Props = { onCreateBlank: () => void onCreateTemplate: () => void onImportDSL: () => void } function FirstEmptyState({ onCreateBlank, onCreateTemplate, onImportDSL, }: Props) { const { t } = useTranslation() const actions: EmptyCreateAction[] = [ { id: 'template', icon: , title: t('newApp.startFromTemplate', { ns: 'app' }), description: t('firstEmpty.templateDescription', { ns: 'app' }), onClick: onCreateTemplate, }, { id: 'blank', icon: , title: t('newApp.startFromBlank', { ns: 'app' }), description: t('firstEmpty.blankDescription', { ns: 'app' }), onClick: onCreateBlank, }, { id: 'dsl', icon: , title: t('importDSL', { ns: 'app' }), description: t('firstEmpty.importDescription', { ns: 'app' }), onClick: onImportDSL, }, ] return (
{EMPTY_PLACEHOLDER_CARD_IDS.map(id => (
))}

{t('firstEmpty.title', { ns: 'app' })}

{actions.slice(0, 2).map(action => ( ))}
{t('firstEmpty.or', { ns: 'app' })}
) } export default FirstEmptyState