Onboarding
This commit is contained in:
@@ -57,20 +57,23 @@ const HEALTH_CHECK_CREDIT_COST = 2;
|
||||
const getHealthCopy = (language: 'de' | 'en' | 'es') => {
|
||||
if (language === 'de') {
|
||||
return {
|
||||
title: 'Health Check',
|
||||
action: 'Neues Foto + Health-Check',
|
||||
running: 'Neues Foto wird analysiert...',
|
||||
cost: `Kosten: ${HEALTH_CHECK_CREDIT_COST} Credits`,
|
||||
creditsLabel: 'Credits',
|
||||
title: 'Health Check',
|
||||
action: 'Health-Scan starten',
|
||||
running: 'Neues Foto wird analysiert...',
|
||||
cost: `Kosten: ${HEALTH_CHECK_CREDIT_COST} Credits`,
|
||||
intro: 'Fotografiere die ganze Pflanze plus auffaellige Blaetter. Danach bekommst du Diagnose, Dringlichkeit und einen konkreten Pflegeplan.',
|
||||
creditsLabel: 'Credits',
|
||||
managePlan: 'Plan verwalten',
|
||||
noCreditsTitle: 'Nicht genug Credits',
|
||||
noCreditsMessage: `Du brauchst ${HEALTH_CHECK_CREDIT_COST} Credits fuer den Health-Check.`,
|
||||
insufficientInline: 'Nicht genug Credits fuer den Health-Check.',
|
||||
timeoutInline: 'Health-Check Timeout. Bitte erneut versuchen.',
|
||||
providerInline: 'Health-Check ist gerade nicht verfuegbar.',
|
||||
issuesTitle: 'Moegliche Ursachen',
|
||||
actionsTitle: 'Sofortmassnahmen',
|
||||
planTitle: '7-Tage-Plan',
|
||||
analysisTitle: 'Analyse',
|
||||
analysisFallback: 'Die Pflanze wirkt insgesamt beurteilbar, aber die gespeicherte Analyse enthaelt noch keine ausformulierte Zusammenfassung. Orientiere dich deshalb an Score, Ursachen und Sofortmassnahmen. Pruefe zuerst die auffaelligsten Blaetter, danach Substratfeuchte und Standort. Wenn die Blaetter innerhalb von 48 Stunden weiter haengen, gelb werden oder Flecken ausbreiten, solltest du ein neues Foto bei hellem indirektem Licht aufnehmen. Ein neuer Health-Scan kann dann genauer zwischen Wasserstress, Lichtstress, Schaedlingen und normaler Blattalterung unterscheiden.',
|
||||
issuesTitle: 'Wahrscheinlichste Ursachen',
|
||||
actionsTitle: 'Sofortmassnahmen',
|
||||
planTitle: '7-Tage-Plan',
|
||||
scoreLabel: 'Gesundheits-Score',
|
||||
healthy: 'Stabil',
|
||||
watch: 'Beobachten',
|
||||
@@ -81,18 +84,21 @@ const getHealthCopy = (language: 'de' | 'en' | 'es') => {
|
||||
|
||||
if (language === 'es') {
|
||||
return {
|
||||
title: 'Health Check',
|
||||
action: 'Foto nuevo + Health-check',
|
||||
running: 'Analizando foto nueva...',
|
||||
cost: `Costo: ${HEALTH_CHECK_CREDIT_COST} creditos`,
|
||||
creditsLabel: 'Creditos',
|
||||
title: 'Health Check',
|
||||
action: 'Iniciar health-scan',
|
||||
running: 'Analizando foto nueva...',
|
||||
cost: `Costo: ${HEALTH_CHECK_CREDIT_COST} creditos`,
|
||||
intro: 'Fotografia la planta completa y las hojas llamativas. Luego recibes diagnostico, urgencia y un plan de cuidado concreto.',
|
||||
creditsLabel: 'Creditos',
|
||||
managePlan: 'Gestionar plan',
|
||||
noCreditsTitle: 'Creditos insuficientes',
|
||||
noCreditsMessage: `Necesitas ${HEALTH_CHECK_CREDIT_COST} creditos para el health-check.`,
|
||||
insufficientInline: 'No hay creditos suficientes para el health-check.',
|
||||
timeoutInline: 'Health-check agotado por tiempo. Intenta de nuevo.',
|
||||
providerInline: 'Health-check no disponible ahora.',
|
||||
issuesTitle: 'Posibles causas',
|
||||
analysisTitle: 'Analisis',
|
||||
analysisFallback: 'La planta se puede evaluar en general, pero este chequeo guardado todavia no contiene un resumen completo. Usa el puntaje, las causas y las acciones inmediatas como guia principal. Revisa primero las hojas mas llamativas, despues la humedad del sustrato y la ubicacion. Si las hojas empeoran en 48 horas, amarillean o las manchas se expanden, toma una foto nueva con luz indirecta clara. Un nuevo health-scan podra diferenciar mejor entre exceso o falta de agua, luz, plagas y envejecimiento normal.',
|
||||
issuesTitle: 'Causas mas probables',
|
||||
actionsTitle: 'Acciones inmediatas',
|
||||
planTitle: 'Plan de 7 dias',
|
||||
scoreLabel: 'Puntaje de salud',
|
||||
@@ -104,10 +110,11 @@ const getHealthCopy = (language: 'de' | 'en' | 'es') => {
|
||||
}
|
||||
|
||||
return {
|
||||
title: 'Health Check',
|
||||
action: 'New Photo + Health Check',
|
||||
running: 'Analyzing new photo...',
|
||||
cost: `Cost: ${HEALTH_CHECK_CREDIT_COST} credits`,
|
||||
title: 'Health Check',
|
||||
action: 'Start health scan',
|
||||
running: 'Analyzing new photo...',
|
||||
cost: `Cost: ${HEALTH_CHECK_CREDIT_COST} credits`,
|
||||
intro: 'Photograph the full plant plus any suspicious leaves. You will get a diagnosis, urgency level, and a concrete care plan.',
|
||||
creditsLabel: 'Credits',
|
||||
managePlan: 'Manage plan',
|
||||
noCreditsTitle: 'Not enough credits',
|
||||
@@ -115,7 +122,9 @@ const getHealthCopy = (language: 'de' | 'en' | 'es') => {
|
||||
insufficientInline: 'Not enough credits for the health check.',
|
||||
timeoutInline: 'Health check timed out. Please try again.',
|
||||
providerInline: 'Health check is unavailable right now.',
|
||||
issuesTitle: 'Likely issues',
|
||||
analysisTitle: 'Analysis',
|
||||
analysisFallback: 'The plant is still assessable, but this saved check does not include a full written summary yet. Use the score, likely causes, and immediate actions as the primary guide. Start by inspecting the most unusual leaves, then check soil moisture and placement. If leaves droop further, yellowing spreads, or spots expand within 48 hours, take a new photo in bright indirect light. A fresh health scan can separate watering stress, light stress, pests, and normal leaf aging more accurately.',
|
||||
issuesTitle: 'Most likely causes',
|
||||
actionsTitle: 'Actions now',
|
||||
planTitle: '7-day plan',
|
||||
scoreLabel: 'Health score',
|
||||
@@ -234,7 +243,7 @@ export default function PlantDetailScreen() {
|
||||
: colors.dangerSoft
|
||||
)
|
||||
: colors.surfaceMuted;
|
||||
const latestStatusColor = latestHealthCheck
|
||||
const latestStatusColor = latestHealthCheck
|
||||
? (
|
||||
latestHealthCheck.status === 'healthy'
|
||||
? colors.success
|
||||
@@ -242,7 +251,10 @@ export default function PlantDetailScreen() {
|
||||
? colors.warning
|
||||
: colors.danger
|
||||
)
|
||||
: colors.textMuted;
|
||||
: colors.textMuted;
|
||||
const latestAnalysisSummary = latestHealthCheck
|
||||
? latestHealthCheck.analysisSummary || healthCopy.analysisFallback
|
||||
: '';
|
||||
|
||||
const timelineEntries = useMemo(() => {
|
||||
const history = plant.wateringHistory && plant.wateringHistory.length > 0
|
||||
@@ -576,9 +588,9 @@ export default function PlantDetailScreen() {
|
||||
<View style={[styles.healthActionCard, { backgroundColor: colors.surface, borderColor: colors.border }]}>
|
||||
<View style={styles.healthActionRow}>
|
||||
<View style={styles.healthActionInfo}>
|
||||
<Text style={[styles.healthActionTitle, { color: textOnSurface }]}>{healthCopy.title}</Text>
|
||||
<Text style={[styles.healthActionMeta, { color: colors.textMuted }]}>{healthCopy.cost}</Text>
|
||||
</View>
|
||||
<Text style={[styles.healthActionTitle, { color: textOnSurface }]}>{healthCopy.title}</Text>
|
||||
<Text style={[styles.healthActionMeta, { color: colors.textMuted }]}>{healthCopy.intro}</Text>
|
||||
</View>
|
||||
<TouchableOpacity
|
||||
style={[
|
||||
styles.healthActionBtn,
|
||||
@@ -638,11 +650,20 @@ export default function PlantDetailScreen() {
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<Text style={[styles.healthTimestamp, { color: colors.textMuted }]}>
|
||||
{healthCopy.lastCheck}: {new Date(latestHealthCheck.generatedAt).toLocaleString(locale)}
|
||||
</Text>
|
||||
|
||||
<View style={styles.healthListBlock}>
|
||||
<Text style={[styles.healthTimestamp, { color: colors.textMuted }]}>
|
||||
{healthCopy.lastCheck}: {new Date(latestHealthCheck.generatedAt).toLocaleString(locale)}
|
||||
</Text>
|
||||
|
||||
{latestAnalysisSummary ? (
|
||||
<View style={[styles.healthAnalysisBox, { backgroundColor: colors.surfaceMuted, borderColor: colors.border }]}>
|
||||
<Text style={[styles.healthListTitle, { color: textOnSurface }]}>{healthCopy.analysisTitle}</Text>
|
||||
<Text style={[styles.healthAnalysisText, { color: colors.textSecondary }]}>
|
||||
{latestAnalysisSummary}
|
||||
</Text>
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
<View style={styles.healthListBlock}>
|
||||
<Text style={[styles.healthListTitle, { color: textOnSurface }]}>{healthCopy.issuesTitle}</Text>
|
||||
{latestHealthCheck.likelyIssues.map((issue, index) => (
|
||||
<View key={`${issue.title}-${index}`} style={styles.healthIssueWrap}>
|
||||
@@ -1110,10 +1131,20 @@ const styles = StyleSheet.create({
|
||||
healthTimestamp: {
|
||||
fontSize: 11,
|
||||
},
|
||||
healthListBlock: {
|
||||
gap: 8,
|
||||
},
|
||||
healthListTitle: {
|
||||
healthListBlock: {
|
||||
gap: 8,
|
||||
},
|
||||
healthAnalysisBox: {
|
||||
borderRadius: 16,
|
||||
borderWidth: 1,
|
||||
padding: 12,
|
||||
gap: 6,
|
||||
},
|
||||
healthAnalysisText: {
|
||||
fontSize: 12,
|
||||
lineHeight: 19,
|
||||
},
|
||||
healthListTitle: {
|
||||
fontSize: 13,
|
||||
fontWeight: '700',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user