diff options
| author | diogo464 <[email protected]> | 2025-08-13 14:02:42 +0100 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-08-13 14:02:42 +0100 |
| commit | 7c20b4e90374350e681d5807142ebc70cea0bfe3 (patch) | |
| tree | 19469018c5e7b2b129ffb1217df370f32fdd2ce6 | |
| parent | 86c0a412d2ed3fb22735e373d951e50ee24cdacd (diff) | |
Update components to use shared StorageData type
- Import StorageData type from lib/storage in all components
- Remove duplicate interface definitions
- Ensure type consistency across components
- Clean up redundant type declarations
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
| -rw-r--r-- | frontend/components/drive/DriveDirectoryClient.tsx | 7 | ||||
| -rw-r--r-- | frontend/components/drive/DriveDirectoryView.tsx | 8 | ||||
| -rw-r--r-- | frontend/components/drive/StorageUsage.tsx | 7 |
3 files changed, 3 insertions, 19 deletions
diff --git a/frontend/components/drive/DriveDirectoryClient.tsx b/frontend/components/drive/DriveDirectoryClient.tsx index c956fec..2a213f9 100644 --- a/frontend/components/drive/DriveDirectoryClient.tsx +++ b/frontend/components/drive/DriveDirectoryClient.tsx | |||
| @@ -37,6 +37,7 @@ import { DriveLsEntry } from "@/lib/drive_types" | |||
| 37 | import { UPLOAD_MAX_FILE_SIZE, UPLOAD_MAX_FILES } from "@/lib/constants" | 37 | import { UPLOAD_MAX_FILE_SIZE, UPLOAD_MAX_FILES } from "@/lib/constants" |
| 38 | import { DriveMoveDialog } from "./DriveMoveDialog" | 38 | import { DriveMoveDialog } from "./DriveMoveDialog" |
| 39 | import { StorageUsage } from "./StorageUsage" | 39 | import { StorageUsage } from "./StorageUsage" |
| 40 | import type { StorageData } from "@/lib/storage" | ||
| 40 | 41 | ||
| 41 | function formatFileSize(bytes: number): string { | 42 | function formatFileSize(bytes: number): string { |
| 42 | if (bytes === 0) return "0 Bytes" | 43 | if (bytes === 0) return "0 Bytes" |
| @@ -67,12 +68,6 @@ interface Breadcrumb { | |||
| 67 | path: string | 68 | path: string |
| 68 | } | 69 | } |
| 69 | 70 | ||
| 70 | interface StorageData { | ||
| 71 | activeDriveUsage: number | ||
| 72 | totalDiskCapacity: number | ||
| 73 | totalDiskUsed: number | ||
| 74 | availableDisk: number | ||
| 75 | } | ||
| 76 | 71 | ||
| 77 | interface DriveDirectoryClientProps { | 72 | interface DriveDirectoryClientProps { |
| 78 | path: string | 73 | path: string |
diff --git a/frontend/components/drive/DriveDirectoryView.tsx b/frontend/components/drive/DriveDirectoryView.tsx index d93dce8..3558537 100644 --- a/frontend/components/drive/DriveDirectoryView.tsx +++ b/frontend/components/drive/DriveDirectoryView.tsx | |||
| @@ -1,12 +1,6 @@ | |||
| 1 | import { DriveLsEntry } from "@/lib/drive_types" | 1 | import { DriveLsEntry } from "@/lib/drive_types" |
| 2 | import { DriveDirectoryClient } from "./DriveDirectoryClient" | 2 | import { DriveDirectoryClient } from "./DriveDirectoryClient" |
| 3 | 3 | import type { StorageData } from "@/lib/storage" | |
| 4 | interface StorageData { | ||
| 5 | activeDriveUsage: number | ||
| 6 | totalDiskCapacity: number | ||
| 7 | totalDiskUsed: number | ||
| 8 | availableDisk: number | ||
| 9 | } | ||
| 10 | 4 | ||
| 11 | interface DriveDirectoryViewProps { | 5 | interface DriveDirectoryViewProps { |
| 12 | path: string | 6 | path: string |
diff --git a/frontend/components/drive/StorageUsage.tsx b/frontend/components/drive/StorageUsage.tsx index a5a1d68..1f963ce 100644 --- a/frontend/components/drive/StorageUsage.tsx +++ b/frontend/components/drive/StorageUsage.tsx | |||
| @@ -1,9 +1,4 @@ | |||
| 1 | interface StorageData { | 1 | import type { StorageData } from "@/lib/storage" |
| 2 | activeDriveUsage: number | ||
| 3 | totalDiskCapacity: number | ||
| 4 | totalDiskUsed: number | ||
| 5 | availableDisk: number | ||
| 6 | } | ||
| 7 | 2 | ||
| 8 | interface StorageUsageProps { | 3 | interface StorageUsageProps { |
| 9 | data: StorageData | 4 | data: StorageData |
