From 896ad1532105db71452f4be54ad5b0c4c650056a Mon Sep 17 00:00:00 2001 From: myrmidex Date: Sat, 12 Jul 2025 23:39:34 +0200 Subject: [PATCH] Clean up old files --- .../js/components/Display/MilestoneModal.tsx | 33 --- .../Display/MilestoneProgressBar.tsx | 167 --------------- .../js/components/Display/PurchaseModal.tsx | 33 --- .../js/components/Display/StatsPanel.tsx | 193 ------------------ 4 files changed, 426 deletions(-) delete mode 100644 resources/js/components/Display/MilestoneModal.tsx delete mode 100644 resources/js/components/Display/MilestoneProgressBar.tsx delete mode 100644 resources/js/components/Display/PurchaseModal.tsx delete mode 100644 resources/js/components/Display/StatsPanel.tsx diff --git a/resources/js/components/Display/MilestoneModal.tsx b/resources/js/components/Display/MilestoneModal.tsx deleted file mode 100644 index 848195a..0000000 --- a/resources/js/components/Display/MilestoneModal.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import AddMilestoneForm from '@/components/Milestones/AddMilestoneForm'; -import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog'; - -interface MilestoneModalProps { - isOpen: boolean; - onClose: () => void; - onSuccess?: () => void; -} - -export default function MilestoneModal({ isOpen, onClose, onSuccess }: MilestoneModalProps) { - const handleSuccess = () => { - if (onSuccess) { - onSuccess(); - } - onClose(); - }; - - return ( - - - - - ADD MILESTONE - - - -
- -
-
-
- ); -} \ No newline at end of file diff --git a/resources/js/components/Display/MilestoneProgressBar.tsx b/resources/js/components/Display/MilestoneProgressBar.tsx deleted file mode 100644 index 36bbd64..0000000 --- a/resources/js/components/Display/MilestoneProgressBar.tsx +++ /dev/null @@ -1,167 +0,0 @@ -import { cn } from '@/lib/utils'; -import { ChevronLeft, ChevronRight, Plus } from 'lucide-react'; -import { useState } from 'react'; - -interface Milestone { - target: number; - label: string; - color: string; -} - -interface MilestoneProgressBarProps { - currentShares: number; - className?: string; - onStatsToggle?: () => void; - showStats?: boolean; - isVisible?: boolean; - onAddPurchase?: () => void; - onHover?: (isHovered: boolean) => void; -} - -const milestones: Milestone[] = [ - { target: 1500, label: '1.5K', color: 'bg-blue-500' }, - { target: 3000, label: '3K', color: 'bg-green-500' }, - { target: 4500, label: '4.5K', color: 'bg-yellow-500' }, - { target: 6000, label: '6K', color: 'bg-red-500' }, -]; - -export default function MilestoneProgressBar({ - currentShares, - className, - onStatsToggle, - showStats = false, - isVisible = false, - onAddPurchase, - onHover -}: MilestoneProgressBarProps) { - const [currentMilestoneIndex, setCurrentMilestoneIndex] = useState(0); - - const currentMilestone = milestones[currentMilestoneIndex]; - const progress = Math.min((currentShares / currentMilestone.target) * 100, 100); - const isCompleted = currentShares >= currentMilestone.target; - - const nextMilestone = () => { - setCurrentMilestoneIndex((prev) => - prev < milestones.length - 1 ? prev + 1 : 0 - ); - }; - - const prevMilestone = () => { - setCurrentMilestoneIndex((prev) => - prev > 0 ? prev - 1 : milestones.length - 1 - ); - }; - - const handleBarClick = () => { - if (onStatsToggle) { - onStatsToggle(); - } - }; - - return ( -
onHover?.(true)} - onMouseLeave={() => onHover?.(false)} - > -
- {/* Progress Bar */} -
- {/* Background pulse for completed milestones */} - {isCompleted && ( -
- )} - - {/* Progress fill */} -
- - {/* Glow effect */} -
-
- - {/* Milestone Info */} -
- {/* Left: Previous milestone button */} - - - {/* Center: Milestone info */} -
-
- {currentShares.toFixed(2)} / {currentMilestone.target} -
- -
- {currentMilestone.label} -
- -
- {isCompleted ? 'COMPLETED' : `${(100 - progress).toFixed(1)}% TO GO`} -
-
- - {/* Right: Add Purchase, Next milestone button and stats toggle */} -
- {/* Add Purchase Button */} - {onAddPurchase && ( - - )} - - - - {/* Stats indicator */} -
- {showStats ? '▲' : '▼'} -
-
-
-
-
- ); -} \ No newline at end of file diff --git a/resources/js/components/Display/PurchaseModal.tsx b/resources/js/components/Display/PurchaseModal.tsx deleted file mode 100644 index 683a91c..0000000 --- a/resources/js/components/Display/PurchaseModal.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import AddPurchaseForm from '@/components/Transactions/AddPurchaseForm'; -import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog'; - -interface PurchaseModalProps { - isOpen: boolean; - onClose: () => void; - onSuccess?: () => void; -} - -export default function PurchaseModal({ isOpen, onClose, onSuccess }: PurchaseModalProps) { - const handleSuccess = () => { - if (onSuccess) { - onSuccess(); - } - onClose(); - }; - - return ( - - - - - ADD PURCHASE - - - -
- -
-
-
- ); -} \ No newline at end of file diff --git a/resources/js/components/Display/StatsPanel.tsx b/resources/js/components/Display/StatsPanel.tsx deleted file mode 100644 index 00ae6f2..0000000 --- a/resources/js/components/Display/StatsPanel.tsx +++ /dev/null @@ -1,193 +0,0 @@ -import { cn } from '@/lib/utils'; -import { useState } from 'react'; - -interface StatsData { - totalShares: number; - totalInvestment: number; - averageCostPerShare: number; - currentPrice?: number; - currentValue?: number; - profitLoss?: number; - profitLossPercentage?: number; -} - -interface StatsPanelProps { - stats: StatsData; - isVisible: boolean; - className?: string; -} - -export default function StatsPanel({ stats, isVisible, className }: StatsPanelProps) { - const [withdrawalRate, setWithdrawalRate] = useState(0.03); // 3% default - - const calculateWithdrawal = (rate: number) => { - if (!stats.currentValue) return 0; - return stats.currentValue * rate; - }; - - const formatCurrency = (amount: number) => { - return new Intl.NumberFormat('de-DE', { - style: 'currency', - currency: 'EUR', - minimumFractionDigits: 2, - }).format(amount); - }; - - const formatPercentage = (percentage: number) => { - return `${percentage >= 0 ? '+' : ''}${percentage.toFixed(2)}%`; - }; - - return ( -
-
-
- - {/* Portfolio Overview */} -
-

- Portfolio -

- -
-
- Shares: - {stats.totalShares.toFixed(6)} -
- -
- Invested: - {formatCurrency(stats.totalInvestment)} -
- -
- Avg Cost: - {formatCurrency(stats.averageCostPerShare)} -
-
-
- - {/* Current Value */} - {stats.currentPrice && ( -
-

- Current Value -

- -
-
- Price: - {formatCurrency(stats.currentPrice)} -
- -
- Value: - {formatCurrency(stats.currentValue || 0)} -
- - {stats.profitLoss !== undefined && ( -
- P&L: - = 0 ? "text-green-400" : "text-red-500" - )}> - {formatCurrency(stats.profitLoss)} - -
- )} - - {stats.profitLossPercentage !== undefined && ( -
- Return: - = 0 ? "text-green-400" : "text-red-500" - )}> - {formatPercentage(stats.profitLossPercentage)} - -
- )} -
-
- )} - - {/* Withdrawal Estimates */} - {stats.currentValue && ( -
-

- Annual Withdrawal -

- -
-
- 3%: - {formatCurrency(calculateWithdrawal(0.03))} -
- -
- 4%: - {formatCurrency(calculateWithdrawal(0.04))} -
- -
- Custom: -
- setWithdrawalRate(Number(e.target.value) / 100)} - className="w-12 bg-transparent text-red-400 text-right text-xs border-b border-red-500/30 focus:border-red-400 outline-none" - min="0" - max="10" - step="0.1" - /> - % -
-
- -
- - {formatCurrency(calculateWithdrawal(withdrawalRate))} -
-
-
- )} - - {/* Monthly Breakdown */} - {stats.currentValue && ( -
-

- Monthly Income -

- -
-
- 3%: - {formatCurrency(calculateWithdrawal(0.03) / 12)} -
- -
- 4%: - {formatCurrency(calculateWithdrawal(0.04) / 12)} -
- -
- Custom: - {formatCurrency(calculateWithdrawal(withdrawalRate) / 12)} -
-
-
- )} -
-
-
- ); -} \ No newline at end of file