🐛 fix(ApiKeysPage): handle case when last_used_at date is invalid to prevent error in moment.js formatting

🎨 style(ApiKeysPage): improve table header className logic for better readability
This commit is contained in:
Cristhian Zanforlin Lousa 2023-08-25 20:06:11 -03:00
commit be0c7ce368

View file

@ -128,7 +128,7 @@ export default function ApiKeysPage() {
<Table className={"table-fixed bg-muted outline-1"}>
<TableHeader
className={
loadingKeys
loadingKeys
? "hidden"
: "table-fixed bg-muted outline-1"
}
@ -179,7 +179,11 @@ export default function ApiKeysPage() {
<TableCell className="truncate py-2">
{moment(api_keys.last_used_at).format(
"YYYY-MM-DD HH:mm"
)}
) === "Invalid date"
? "-"
: moment(api_keys.last_used_at).format(
"YYYY-MM-DD HH:mm"
)}
</TableCell>
<TableCell className="flex w-[100px] py-2 text-right">
<div className="flex">