From 597b7a58836ec8b3511746e0a49478688aefc534 Mon Sep 17 00:00:00 2001 From: Felix Schulze Date: Sat, 6 Dec 2025 15:20:29 +0100 Subject: [PATCH] calc tooltips --- src/app/components/FireCalculatorForm.tsx | 94 +++++++++++++++++++---- src/components/ui/button.tsx | 2 +- 2 files changed, 80 insertions(+), 16 deletions(-) diff --git a/src/app/components/FireCalculatorForm.tsx b/src/app/components/FireCalculatorForm.tsx index 219c66c..85f8580 100644 --- a/src/app/components/FireCalculatorForm.tsx +++ b/src/app/components/FireCalculatorForm.tsx @@ -22,8 +22,24 @@ import { import { Slider } from '@/components/ui/slider'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; import type { NameType, ValueType } from 'recharts/types/component/DefaultTooltipContent'; -import { Calculator, Percent } from 'lucide-react'; +import { Calculator, Info, Percent } from 'lucide-react'; +import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'; import BlurThing from './blur-thing'; +import Link from 'next/link'; + +// Helper component for info tooltips next to form labels +function InfoTooltip({ content }: Readonly<{ content: string }>) { + return ( + + + + + + {content} + + + ); +} // Schema for form validation const formSchema = z.object({ @@ -359,7 +375,10 @@ export default function FireCalculatorForm() { name="startingCapital" render={({ field }) => ( - Starting Capital + + Starting Capital + + ( - Monthly Savings + + Monthly Savings + + ( - Current Age + + Current Age + + ( - Life Expectancy (Age) + + Life Expectancy (Age) + + ( - Expected Annual Growth Rate (%) + + Expected Annual Growth Rate (%) + + ( - Annual Inflation Rate (%) + + Annual Inflation Rate (%) + + ( - Desired Monthly Allowance (Today's Value) + + Monthly Allowance (Today's Value) + + ( - Retirement Age: {field.value as number} + + Retirement Age: {field.value as number} + + ( - Coast FIRE Age (Optional) - Stop contributing at age: + + {' '} + Age (Optional): + + ( - Barista FIRE Income (Monthly during Retirement) + + {' '} + Monthly Income + + ( - Simulation Mode + + Simulation Mode + + ( - Withdrawal Strategy + + Withdrawal Strategy + + svg]:px-3.5',