40 - Centralise Milestone/Tracker/TrackerAsset interfaces to types/domain.ts

This commit is contained in:
myrmidex 2026-05-02 20:28:43 +02:00
parent 6e76ce9c68
commit 941cd60680
4 changed files with 23 additions and 32 deletions

View file

@ -1,10 +1,5 @@
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils';
import type { Milestone } from '@/types/domain';
interface Milestone {
target: number;
description: string;
created_at: string;
}
interface ProgressBarProps { interface ProgressBarProps {
currentQuantity: number; currentQuantity: number;

View file

@ -2,12 +2,7 @@ import { cn } from '@/lib/utils';
import { Plus, ChevronRight } from 'lucide-react'; import { Plus, ChevronRight } from 'lucide-react';
import { useState } from 'react'; import { useState } from 'react';
import ComponentTitle from '@/components/ui/ComponentTitle'; import ComponentTitle from '@/components/ui/ComponentTitle';
import type { Milestone } from '@/types/domain';
interface Milestone {
target: number;
description: string;
created_at: string;
}
interface StatsBoxProps { interface StatsBoxProps {
stats: { stats: {

View file

@ -6,6 +6,7 @@ import OnboardingFlow from '@/components/Onboarding/OnboardingFlow';
import TerminalSpinner from '@/components/ui/TerminalSpinner'; import TerminalSpinner from '@/components/ui/TerminalSpinner';
import { Head } from '@inertiajs/react'; import { Head } from '@inertiajs/react';
import { useCallback, useEffect, useState } from 'react'; import { useCallback, useEffect, useState } from 'react';
import type { Milestone, Tracker, TrackerAsset } from '@/types/domain';
interface PurchaseSummary { interface PurchaseSummary {
total_shares: number; total_shares: number;
@ -17,26 +18,6 @@ interface CurrentPrice {
current_price: number | null; current_price: number | null;
} }
interface Milestone {
target: number;
description: string;
created_at: string;
}
interface TrackerAsset {
id: number;
symbol: string;
full_name: string | null;
}
interface Tracker {
id: number;
label: string;
unit: string;
price_tracking_enabled: boolean;
asset: TrackerAsset | null;
}
export default function Dashboard() { export default function Dashboard() {
const [purchaseData, setPurchaseData] = useState<PurchaseSummary>({ const [purchaseData, setPurchaseData] = useState<PurchaseSummary>({
total_shares: 0, total_shares: 0,

View file

@ -0,0 +1,20 @@
export interface Milestone {
id?: number;
target: number;
description: string;
created_at: string;
}
export interface TrackerAsset {
id: number;
symbol: string;
full_name: string | null;
}
export interface Tracker {
id: number;
label: string;
unit: string;
price_tracking_enabled: boolean;
asset: TrackerAsset | null;
}