'use client' import type { ReactNode } from 'react' import type { App } from '@/models/explore' import type { TryAppSelection } from '@/types/try-app' import { useTranslation } from 'react-i18next' import LearnDify from '@/app/components/explore/learn-dify' import { STEP_BY_STEP_TOUR_TARGETS } from '@/app/components/step-by-step-tour/target-registry' 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 target: string onClick: () => void } type Props = { onCreateBlank: () => void onCreateLearnDify?: (app: App) => void onCreateTemplate: () => void onImportDSL: () => void onTryLearnDify?: (params: TryAppSelection) => void showLearnDify: boolean } function FirstEmptyState({ onCreateBlank, onCreateLearnDify, onCreateTemplate, onImportDSL, onTryLearnDify, showLearnDify, }: Props) { const { t } = useTranslation() const actions: EmptyCreateAction[] = [ { id: 'template', icon: , title: t(($) => $['newApp.startFromTemplate'], { ns: 'app' }), description: t(($) => $['firstEmpty.templateDescription'], { ns: 'app' }), onClick: onCreateTemplate, target: STEP_BY_STEP_TOUR_TARGETS.studioEmptyTemplate, }, { id: 'blank', icon: , title: t(($) => $['newApp.startFromBlank'], { ns: 'app' }), description: t(($) => $['firstEmpty.blankDescription'], { ns: 'app' }), onClick: onCreateBlank, target: STEP_BY_STEP_TOUR_TARGETS.studioEmptyBlank, }, { id: 'dsl', icon: , title: t(($) => $.importDSL, { ns: 'app' }), description: t(($) => $['firstEmpty.importDescription'], { ns: 'app' }), onClick: onImportDSL, target: STEP_BY_STEP_TOUR_TARGETS.studioEmptyDSL, }, ] return (