mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 12:31:54 +00:00
48f633889a
* fix: add suppressHydrationWarning to resolve console errors * chore: add server-only library * WIP: Mock API for providers and start rendering data * chore: relocate utils folder to proper directory * chore: install shadcn for tables, adding sttings page * refactor: improve sidebar display behavior * chore: add fake data to the dataProviders * chore: remove the old table and rename ProviderInfo component * refactor: improve sidebar display behavior adding a custom hook * feat: the Providers table is rendering real data * chore: set the default valuef or isCollapse to false * chore: Added a helper function getProviderAttributes for cleaner access to provider attributes
28 lines
728 B
TypeScript
28 lines
728 B
TypeScript
import { format, parseISO } from "date-fns";
|
|
import React from "react";
|
|
|
|
interface DateWithTimeProps {
|
|
dateTime: string; // e.g., "2024-07-17T09:55:14.191475Z"
|
|
showTime?: boolean;
|
|
}
|
|
|
|
export const DateWithTime: React.FC<DateWithTimeProps> = ({
|
|
dateTime,
|
|
showTime = true,
|
|
}) => {
|
|
const date = parseISO(dateTime);
|
|
const formattedDate = format(date, "MMM dd, yyyy");
|
|
const formattedTime = format(date, "p 'UTC'");
|
|
|
|
return (
|
|
<div className="max-w-fit">
|
|
<div className="flex flex-col items-start">
|
|
<span className="text-md font-semibold">{formattedDate}</span>
|
|
{showTime && (
|
|
<span className="text-sm text-gray-500">{formattedTime}</span>
|
|
)}
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|