File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
compass-components/src/hooks
compass-data-modeling/src/components Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ import { formatDate } from '../utils/format-date';
22
33import { useState , useEffect } from 'react' ;
44
5+ export function useFormattedDate ( timestamp : undefined ) : undefined ;
56export function useFormattedDate ( timestamp : number ) : string ;
7+ export function useFormattedDate ( timestamp ?: number ) : string | undefined ;
68export function useFormattedDate ( timestamp ?: number ) : string | undefined {
79 const [ formattedDate , setFormattedDate ] = useState ( ( ) =>
810 typeof timestamp === 'number' ? formatDate ( timestamp ) : undefined
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ export function DiagramCard({
8888} ) {
8989 const darkmode = useDarkMode ( ) ;
9090 // the hook does support undefined, but the function overload is somehow not transferred here
91- const formattedDate = useFormattedDate ( diagram . lastModified as number ) ;
91+ const formattedDate = useFormattedDate ( diagram . lastModified ) ;
9292 return (
9393 < Card
9494 className = { diagramCardStyles }
You can’t perform that action at this time.
0 commit comments