fix(pitch-deck): TheAsk slide — fix client-side crash
All checks were successful
Build pitch-deck / build-push-deploy (push) Successful in 1m12s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-consent (push) Successful in 34s
CI / test-python-voice (push) Successful in 35s
CI / test-bqas (push) Successful in 36s
All checks were successful
Build pitch-deck / build-push-deploy (push) Successful in 1m12s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-consent (push) Successful in 34s
CI / test-python-voice (push) Successful in 35s
CI / test-bqas (push) Successful in 36s
- Replace emoji with Landmark icon - Add JSON.parse fallback for use_of_funds - Guard pieData labels and amounts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import GradientText from '../ui/GradientText'
|
||||
import FadeInView from '../ui/FadeInView'
|
||||
import AnimatedCounter from '../ui/AnimatedCounter'
|
||||
import GlassCard from '../ui/GlassCard'
|
||||
import { Landmark } from 'lucide-react'
|
||||
import { Target, Calendar, FileText } from 'lucide-react'
|
||||
import { PieChart, Pie, Cell, ResponsiveContainer, Tooltip } from 'recharts'
|
||||
|
||||
@@ -41,13 +42,15 @@ function formatTargetDate(dateStr: string, lang: Language): string {
|
||||
|
||||
export default function TheAskSlide({ lang, funding }: TheAskSlideProps) {
|
||||
const i = t(lang)
|
||||
const useOfFunds = funding?.use_of_funds || []
|
||||
const amount = funding?.amount_eur || 0
|
||||
const de = lang === 'de'
|
||||
const rawFunds = funding?.use_of_funds
|
||||
const useOfFunds = Array.isArray(rawFunds) ? rawFunds : (typeof rawFunds === 'string' ? JSON.parse(rawFunds) : [])
|
||||
const amount = Number(funding?.amount_eur) || 0
|
||||
const { target, suffix } = formatFundingAmount(amount)
|
||||
|
||||
const pieData = useOfFunds.map((item) => ({
|
||||
name: lang === 'de' ? item.label_de : item.label_en,
|
||||
value: item.percentage,
|
||||
const pieData = useOfFunds.map((item: Record<string, unknown>) => ({
|
||||
name: (de ? item.label_de : item.label_en) as string || 'N/A',
|
||||
value: Number(item.percentage) || 0,
|
||||
}))
|
||||
|
||||
return (
|
||||
@@ -153,7 +156,7 @@ export default function TheAskSlide({ lang, funding }: TheAskSlideProps) {
|
||||
<FadeInView delay={0.6} className="mt-4">
|
||||
<div className="bg-gradient-to-r from-indigo-500/10 to-emerald-500/10 border border-indigo-500/20 rounded-xl px-5 py-3">
|
||||
<div className="flex items-start gap-3">
|
||||
<span className="text-lg mt-0.5">🏛️</span>
|
||||
<Landmark className="w-5 h-5 text-indigo-400 mt-0.5 shrink-0" />
|
||||
<div>
|
||||
<p className="text-sm font-bold text-white mb-1">
|
||||
{de ? 'BAFA INVEST — Zuschuss für Wagniskapital' : 'BAFA INVEST — Venture Capital Grant'}
|
||||
|
||||
Reference in New Issue
Block a user