mirror of
https://github.com/ManInDark/HabitTrove.git
synced 2026-01-21 06:34:30 +01:00
Initial commit
This commit is contained in:
35
lib/types.ts
Normal file
35
lib/types.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
export type Habit = {
|
||||
id: string
|
||||
name: string
|
||||
description: string
|
||||
frequency: 'daily' | 'weekly' | 'monthly'
|
||||
coinReward: number
|
||||
completions: string[] // Array of ISO date strings
|
||||
}
|
||||
|
||||
export type WishlistItemType = {
|
||||
id: string
|
||||
name: string
|
||||
description: string
|
||||
coinCost: number
|
||||
}
|
||||
|
||||
export type TransactionType = 'HABIT_COMPLETION' | 'HABIT_UNDO' | 'WISH_REDEMPTION' | 'MANUAL_ADJUSTMENT';
|
||||
|
||||
export interface CoinTransaction {
|
||||
id: string;
|
||||
amount: number;
|
||||
type: TransactionType;
|
||||
description: string;
|
||||
timestamp: string;
|
||||
relatedItemId?: string;
|
||||
}
|
||||
|
||||
export interface HabitsData {
|
||||
habits: Habit[];
|
||||
}
|
||||
|
||||
export interface CoinsData {
|
||||
balance: number;
|
||||
transactions: CoinTransaction[];
|
||||
}
|
||||
6
lib/utils.ts
Normal file
6
lib/utils.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { clsx, type ClassValue } from "clsx"
|
||||
import { twMerge } from "tailwind-merge"
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
}
|
||||
Reference in New Issue
Block a user