fix: update recent transactions badge styling and localize time formatting
- Added padding to the "Rückerstattet" badge for improved visual appearance. - Updated time formatting in the formatRelativeTime function to use German language strings for better localization.
This commit is contained in:
@@ -24,7 +24,7 @@ function statusBadge(status: string) {
|
|||||||
);
|
);
|
||||||
case "released":
|
case "released":
|
||||||
return (
|
return (
|
||||||
<Badge variant="secondary" className="text-xs font-normal text-emerald-600 dark:text-emerald-400">
|
<Badge variant="secondary" className="text-xs font-normal text-emerald-600 dark:text-emerald-400 px-3">
|
||||||
Rückerstattet
|
Rückerstattet
|
||||||
</Badge>
|
</Badge>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* Formatiert einen Timestamp als relative Zeitangabe.
|
* Formatiert einen Timestamp als relative Zeitangabe.
|
||||||
* Beispiele: "Just now", "5m ago", "3h ago", "2d ago", "12. Mär"
|
* Beispiele: "Gerade eben", "vor 5 Min.", "vor 3 Std.", "vor 2 Tagen", "12. Mär"
|
||||||
*/
|
*/
|
||||||
export function formatRelativeTime(timestamp: number): string {
|
export function formatRelativeTime(timestamp: number): string {
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
@@ -9,10 +9,10 @@ export function formatRelativeTime(timestamp: number): string {
|
|||||||
const hours = Math.floor(diff / 3600000);
|
const hours = Math.floor(diff / 3600000);
|
||||||
const days = Math.floor(diff / 86400000);
|
const days = Math.floor(diff / 86400000);
|
||||||
|
|
||||||
if (minutes < 1) return "Just now";
|
if (minutes < 1) return "Gerade eben";
|
||||||
if (minutes < 60) return `${minutes}m ago`;
|
if (minutes < 60) return `vor ${minutes} Min.`;
|
||||||
if (hours < 24) return `${hours}h ago`;
|
if (hours < 24) return `vor ${hours} Std.`;
|
||||||
if (days < 7) return `${days}d ago`;
|
if (days < 7) return days === 1 ? "vor 1 Tag" : `vor ${days} Tagen`;
|
||||||
return new Date(timestamp).toLocaleDateString("de-DE", {
|
return new Date(timestamp).toLocaleDateString("de-DE", {
|
||||||
day: "numeric",
|
day: "numeric",
|
||||||
month: "short",
|
month: "short",
|
||||||
|
|||||||
Reference in New Issue
Block a user