import { Type, Hash, CircleDot, ListChecks, CheckCircle } from 'lucide-react-native'; import type { InputType, MemoLogger } from './types'; export const SWIPE_THRESHOLD = 80; export const TYPE_ICONS = { text: Type, number: Hash, singleselect: CircleDot, multiselect: ListChecks, check: CheckCircle, } as const; export const TYPE_OPTION_KEYS: InputType[] = [ 'singleselect', 'multiselect', 'text', 'number', 'check', ]; export const NUMBER_UNITS: { id: string; label: string; unit: string; isPrefix?: boolean }[] = [ { id: 'plain', label: '#', unit: '' }, { id: 'currency', label: '$', unit: '$', isPrefix: true }, { id: 'percent', label: '%', unit: '%' }, { id: 'duration', label: 'min', unit: 'min' }, { id: 'weight', label: 'kg', unit: 'kg' }, { id: 'distance', label: 'km', unit: 'km' }, ]; export const isUnitPrefix = (unit?: string): boolean => NUMBER_UNITS.some(u => u.unit === unit && u.isPrefix); export function formatValue(value: number | string, unit?: string): string { const str = String(value); if (!unit) return str; return isUnitPrefix(unit) ? `${unit}${str}` : `${str}${unit}`; } export const DEFAULT_LOGGERS: MemoLogger[] = [ { id: 'water', name: 'Water', icon: '💧', type: 'singleselect', unit: 'ml', options: [ { label: '1 glass', value: 250 }, { label: '2 glasses', value: 500 }, { label: '1 liter', value: 1000 }, ], }, { id: 'mood', name: 'Mood', icon: '😊', type: 'singleselect', options: [ { icon: '😢', value: 1 }, { icon: '😕', value: 2 }, { icon: '😐', value: 3 }, { icon: '🙂', value: 4 }, { icon: '😊', value: 5 }, ], }, { id: 'exercise', name: 'Exercise', icon: '🏃', type: 'singleselect', options: [ { label: '15 min', value: 15 }, { label: '30 min', value: 30 }, { label: '45 min', value: 45 }, { label: '1 hour', value: 60 }, ], }, { id: 'count', name: 'Count', icon: '🔢', type: 'number' }, { id: 'spending', name: 'Spending', icon: '💵', type: 'number', unit: '$' }, { id: 'progress', name: 'Progress', icon: '📊', type: 'number', unit: '%' }, { id: 'duration', name: 'Duration', icon: '⏱️', type: 'number', unit: 'min' }, { id: 'weight', name: 'Weight', icon: '⚖️', type: 'number', unit: 'kg' }, { id: 'distance', name: 'Distance', icon: '📏', type: 'number', unit: 'km' }, ];