-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor:perfromanxce, optimization , disabled button if revoked
- Loading branch information
1 parent
31472cc
commit 518e183
Showing
6 changed files
with
50 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export const formatKey = (key: string): string => { | ||
// Replace underscores with spaces and split camelCase words with a space | ||
const result = key | ||
.replace(/([A-Z])/g, " $1") // Insert space before each uppercase letter | ||
.replace(/_/g, " ") // Replace underscores with spaces | ||
.trim(); // Remove leading and trailing spaces | ||
|
||
// Capitalize the first letter of each word | ||
return result | ||
.split(" ") | ||
.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()) | ||
.join(" "); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export const formatTime = (timestamp: number, timeType: string) => { | ||
if (timestamp === 0 && timeType === "revocationTime") { | ||
return "No Previous revocation"; | ||
} | ||
if (timestamp === 0 && timeType === "expirationTime") { | ||
return "No Expiration"; | ||
} | ||
const date = new Date(timestamp * 1000); // Convert from seconds to milliseconds | ||
return date.toLocaleString(); // Format the date as a human-readable string | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters