style: clean up code formatting and remove trailing whitespace
refactor: reorganize imports and fix type imports
This commit is contained in:
1 parent
d3704602fd
commit
47c04de6fe
232 files changed
+7140
-4798
No files matched your search
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import { Clock } from "lucide-react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
interface AuctionCountdownProps {
|
||||
@@ -30,7 +30,7 @@ export function AuctionCountdown({
|
||||
|
||||
const calculateTimeRemaining = () => {
|
||||
const endTime = new Date(endsAt).getTime();
|
||||
const now = new Date().getTime();
|
||||
const now = Date.now();
|
||||
const total = endTime - now;
|
||||
|
||||
if (total <= 0) {
|
||||
@@ -61,19 +61,19 @@ export function AuctionCountdown({
|
||||
// Determinar cor baseada no tempo restante
|
||||
const getColorClass = () => {
|
||||
const totalMinutes = timeRemaining.hours * 60 + timeRemaining.minutes;
|
||||
|
||||
|
||||
if (timeRemaining.total <= 0) {
|
||||
return "text-red-600 dark:text-red-400";
|
||||
}
|
||||
|
||||
|
||||
if (totalMinutes < 5) {
|
||||
return "text-red-500 dark:text-red-400 font-semibold animate-pulse";
|
||||
}
|
||||
|
||||
|
||||
if (totalMinutes < 60) {
|
||||
return "text-yellow-600 dark:text-yellow-400";
|
||||
}
|
||||
|
||||
|
||||
return "text-green-600 dark:text-green-400";
|
||||
};
|
||||
|
||||
@@ -84,7 +84,7 @@ export function AuctionCountdown({
|
||||
}
|
||||
|
||||
const totalMinutes = timeRemaining.hours * 60 + timeRemaining.minutes;
|
||||
|
||||
|
||||
if (totalMinutes < 5) {
|
||||
return "Termina em breve";
|
||||
}
|
||||
@@ -102,13 +102,10 @@ export function AuctionCountdown({
|
||||
|
||||
return (
|
||||
<div className={cn("flex items-center gap-1.5", className)}>
|
||||
{showIcon && (
|
||||
<Clock className={cn("h-3.5 w-3.5", getColorClass())} />
|
||||
)}
|
||||
{showIcon && <Clock className={cn("h-3.5 w-3.5", getColorClass())} />}
|
||||
<span className={cn("text-xs font-medium", getColorClass())}>
|
||||
{getTimeText()}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user