Skip to content

Commit

Permalink
Merge pull request #298 from jeafreezy/fixes
Browse files Browse the repository at this point in the history
fixes #297
  • Loading branch information
omranlm authored Oct 22, 2024
2 parents d60e457 + 66f8ab8 commit 1d7f0a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/landing/kpi/kpi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const fetchKPIStats = async (): Promise<TKPIResponse> => {
};

const Kpi = () => {
const { data, isLoading,isError,error} = useQuery({
const { data, isLoading, isError, error } = useQuery({
queryKey: ["kpis"],
queryFn: fetchKPIStats,
});
Expand All @@ -31,7 +31,7 @@ const Kpi = () => {
<section className={styles.kpiContainer}>
<div>
<h2>Error fetching KPI Stats</h2>
<p>{(error as Error)?.message || 'An unknown error occurred.'}</p>
<p>{(error as Error)?.message || "An unknown error occurred."}</p>
</div>
</section>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ const columnDefinitions = (
header:
APP_CONTENT.models.modelsDetailsCard.trainingHistoryTableHeader.duration,
accessorFn: (row) =>
formatDuration(new Date(row.started_at), new Date(row.finished_at)),
row.finished_at && row.started_at
? formatDuration(new Date(row.started_at), new Date(row.finished_at))
: "-",
cell: (row) => (
<span title={row.getValue() as string}>{row.getValue() as string}</span>
),
Expand Down

0 comments on commit 1d7f0a9

Please sign in to comment.