import React, { useEffect, useState } from 'react'; import { AppMetadata } from '../types'; import { geminiService } from '../services/geminiService'; interface DashboardProps { metadata: AppMetadata; } export const Dashboard: React.FC = ({ metadata }) => { const [greeting, setGreeting] = useState('Loading welcome message...'); const [features, setFeatures] = useState([]); const [isAiLoading, setIsAiLoading] = useState(true); useEffect(() => { const initializeApp = async () => { setIsAiLoading(true); try { const [aiGreeting, aiFeatures] = await Promise.all([ geminiService.getAppContextualGreeting(metadata), geminiService.getSmartFeatureIdeas(metadata) ]); setGreeting(aiGreeting); setFeatures(aiFeatures); } catch (error) { console.error("AI Initialization failed", error); setGreeting(`Welcome to ${metadata.name}`); } finally { setIsAiLoading(false); } }; initializeApp(); }, [metadata]); return (

Identity

{metadata.name}

{metadata.description}

Smart Assistant Greeting

"{greeting}"

Dynamic Smart Features

    {isAiLoading ? ( [1, 2, 3].map(i =>
  • ) ) : ( features.map((feature, idx) => (
  • {feature}
  • )) )}

Core Capabilities

{[ { label: 'Data Tracking', icon: 'M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z' }, { label: 'Cloud Sync', icon: 'M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z' }, { label: 'AI Optimization', icon: 'M13 10V3L4 14h7v7l9-11h-7z' }, { label: 'Privacy First', icon: 'M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z' }, ].map((item, idx) => (
{item.label}
))}
); };