Move types to lib directory for better organization
- Move types/location.ts to lib/types.ts - Update all imports from @/types/location to @/lib/types - Remove empty types/ directory - Better aligns with Next.js conventions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Device } from '@/types/location';
|
||||
import { Device } from '@/lib/types';
|
||||
|
||||
export const DEVICES: Record<string, Device> = {
|
||||
'10': { id: '10', name: 'Device A', color: '#e74c3c' },
|
||||
|
||||
30
lib/types.ts
Normal file
30
lib/types.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
export interface Location {
|
||||
id?: number;
|
||||
latitude: number | string; // NocoDB returns string
|
||||
longitude: number | string; // NocoDB returns string
|
||||
timestamp: string;
|
||||
user_id: number | string; // NocoDB returns string "0" for MQTT devices
|
||||
first_name: string | null;
|
||||
last_name: string | null;
|
||||
username: string | null;
|
||||
marker_label: string | null;
|
||||
display_time: string | null;
|
||||
chat_id: number | string; // Also string in API response
|
||||
battery?: number | null;
|
||||
speed?: number | null;
|
||||
created_at?: string;
|
||||
}
|
||||
|
||||
export interface LocationResponse {
|
||||
success: boolean;
|
||||
current: Location | null;
|
||||
history: Location[];
|
||||
total_points: number;
|
||||
last_updated: string;
|
||||
}
|
||||
|
||||
export interface Device {
|
||||
id: string;
|
||||
name: string;
|
||||
color: string;
|
||||
}
|
||||
Reference in New Issue
Block a user