Refactor and enhance UI components across multiple pages
- Improved import organization and formatting in PlaylistsPage, RegisterPage, SoundsPage, SettingsPage, and UsersPage for better readability. - Added error handling and user feedback with toast notifications in SoundsPage and SettingsPage. - Enhanced user experience by implementing debounced search functionality in PlaylistsPage and SoundsPage. - Updated the layout and structure of forms in SettingsPage and UsersPage for better usability. - Improved accessibility and semantics by ensuring proper labeling and descriptions in forms. - Fixed minor bugs related to state management and API calls in various components.
This commit is contained in:
@@ -39,7 +39,7 @@ function parseSize(bytes: number, binary: boolean = false): FileSize {
|
||||
|
||||
return {
|
||||
value: Math.round(value * 100) / 100, // Round to 2 decimal places
|
||||
unit: FILE_SIZE_UNITS[safeUnitIndex]
|
||||
unit: FILE_SIZE_UNITS[safeUnitIndex],
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,9 @@ export function formatSize(bytes: number, binary: boolean = false): string {
|
||||
* @param binary Whether to use binary (1024) or decimal (1000) units
|
||||
* @returns Object with numeric value and unit string
|
||||
*/
|
||||
export function formatSizeObject(bytes: number, binary: boolean = false): FileSize {
|
||||
export function formatSizeObject(
|
||||
bytes: number,
|
||||
binary: boolean = false,
|
||||
): FileSize {
|
||||
return parseSize(bytes, binary)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user