40 - Centralise Milestone/Tracker/TrackerAsset interfaces to types/domain.ts
This commit is contained in:
parent
6e76ce9c68
commit
941cd60680
4 changed files with 23 additions and 32 deletions
|
|
@ -1,10 +1,5 @@
|
|||
import { cn } from '@/lib/utils';
|
||||
|
||||
interface Milestone {
|
||||
target: number;
|
||||
description: string;
|
||||
created_at: string;
|
||||
}
|
||||
import type { Milestone } from '@/types/domain';
|
||||
|
||||
interface ProgressBarProps {
|
||||
currentQuantity: number;
|
||||
|
|
|
|||
|
|
@ -2,12 +2,7 @@ import { cn } from '@/lib/utils';
|
|||
import { Plus, ChevronRight } from 'lucide-react';
|
||||
import { useState } from 'react';
|
||||
import ComponentTitle from '@/components/ui/ComponentTitle';
|
||||
|
||||
interface Milestone {
|
||||
target: number;
|
||||
description: string;
|
||||
created_at: string;
|
||||
}
|
||||
import type { Milestone } from '@/types/domain';
|
||||
|
||||
interface StatsBoxProps {
|
||||
stats: {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import OnboardingFlow from '@/components/Onboarding/OnboardingFlow';
|
|||
import TerminalSpinner from '@/components/ui/TerminalSpinner';
|
||||
import { Head } from '@inertiajs/react';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import type { Milestone, Tracker, TrackerAsset } from '@/types/domain';
|
||||
|
||||
interface PurchaseSummary {
|
||||
total_shares: number;
|
||||
|
|
@ -17,26 +18,6 @@ interface CurrentPrice {
|
|||
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() {
|
||||
const [purchaseData, setPurchaseData] = useState<PurchaseSummary>({
|
||||
total_shares: 0,
|
||||
|
|
|
|||
20
resources/js/types/domain.ts
Normal file
20
resources/js/types/domain.ts
Normal 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;
|
||||
}
|
||||
Loading…
Reference in a new issue