diff --git a/app/components/cards/drink.card.tsx b/app/components/cards/drink.card.tsx index 5e001fe..8a9054c 100644 --- a/app/components/cards/drink.card.tsx +++ b/app/components/cards/drink.card.tsx @@ -17,7 +17,6 @@ function toDate(value: Date | string | null | undefined): Date | null { } function DrinkCard(arg:Arguments) { - var trimmedDescription = arg.drink.description.length > 120 ? arg.drink.description.substring(0, 120) + "..." : arg.drink.description; var link = "/inventory/"; switch (arg.drink.type) { @@ -61,10 +60,7 @@ function DrinkCard(arg:Arguments) { } const drinkAddedAt = toDate((arg.drink as { addedAt?: Date | string | null }).addedAt ?? null); - const latestTimestamp = drinkAddedAt && (!latestActivity || drinkAddedAt.getTime() > latestActivity.getTime()) - ? drinkAddedAt - : latestActivity; - const isNewlyAdded = latestTimestamp ? (Date.now() - latestTimestamp.getTime()) <= 30 * 24 * 60 * 60 * 1000 : false; + const isNewlyAdded = drinkAddedAt ? (Date.now() - drinkAddedAt.getTime()) <= 30 * 24 * 60 * 60 * 1000 : false; const isRecentlyRestocked = latestActivity ? (Date.now() - latestActivity.getTime()) <= 14 * 24 * 60 * 60 * 1000 : false; return ( @@ -76,7 +72,7 @@ function DrinkCard(arg:Arguments) { className='position-absolute top-0 start-0 m-2 text-wrap' style={{ zIndex: 2 }} > - {isNewlyAdded && isRecentlyRestocked ? "New · Restocked" : isNewlyAdded ? "New" : "Recently added"} + {isNewlyAdded && isRecentlyRestocked ? "New · Restocked" : isNewlyAdded ? "New" : "Restocked"} ) : null }