feat: implement plant health check functionality with AI analysis, credit management, and UI integration

This commit is contained in:
2026-04-08 21:27:50 +02:00
parent de8130686a
commit 09078c3c20
5 changed files with 46 additions and 21 deletions

View File

@@ -99,9 +99,9 @@ export const ResultCard: React.FC<ResultCardProps> = ({
<View style={styles.careGrid}>
{[
{ icon: 'water' as const, label: t.water, value: result.careInfo.waterIntervalDays <= 7 ? t.waterModerate : t.waterLittle, color: colors.info, bg: colors.infoSoft },
{ icon: 'sunny' as const, label: t.light, value: result.careInfo.light, color: colors.warning, bg: colors.warningSoft },
{ icon: 'thermometer' as const, label: t.temp, value: result.careInfo.temp, color: colors.danger, bg: colors.dangerSoft },
{ icon: 'water' as const, label: t.water, value: t.waterEveryXDays.replace('{0}', result.careInfo.waterIntervalDays.toString()), color: colors.info, bg: colors.infoSoft },
{ icon: 'sunny' as const, label: t.light, value: result.careInfo.light || t.unknown, color: colors.warning, bg: colors.warningSoft },
{ icon: 'thermometer' as const, label: t.temp, value: result.careInfo.temp || t.unknown, color: colors.danger, bg: colors.dangerSoft },
].map((item) => (
<View key={item.label} style={[styles.careCard, { backgroundColor: colors.surface, borderColor: colors.border }]}>
<View style={[styles.careIcon, { backgroundColor: item.bg }]}>
@@ -118,8 +118,8 @@ export const ResultCard: React.FC<ResultCardProps> = ({
<Text style={[styles.detailsTitle, { color: colors.textSecondary }]}>{t.detailedCare}</Text>
{[
{ text: t.careTextWater.replace('{0}', result.careInfo.waterIntervalDays.toString()), color: colors.success },
{ text: t.careTextLight.replace('{0}', result.careInfo.light), color: colors.warning },
{ text: t.careTextTemp.replace('{0}', result.careInfo.temp), color: colors.danger },
{ text: t.careTextLight.replace('{0}', result.careInfo.light || t.unknown), color: colors.warning },
{ text: t.careTextTemp.replace('{0}', result.careInfo.temp || t.unknown), color: colors.danger },
].map((item, i) => (
<View key={i} style={styles.detailRow}>
<View style={[styles.detailDot, { backgroundColor: item.color }]} />