File tree Expand file tree Collapse file tree 3 files changed +24
-14
lines changed Expand file tree Collapse file tree 3 files changed +24
-14
lines changed Original file line number Diff line number Diff line change 1
1
import React , { useEffect , useState } from "react" ;
2
2
import { getHeatMapData } from "@/handlers/api/analytics.handler" ;
3
3
import { useConfig } from "@/contexts/ConfigContext" ;
4
+ import { Tooltip } from "@/components/ui/tooltip" ;
4
5
5
6
type HeatMapEntry = {
6
7
date : string ;
7
8
count : number ;
8
9
} ;
9
10
10
11
export default function AssetHeatMap ( ) {
11
- const { exImmichUrl } = useConfig ( ) ;
12
+ const { exImmichUrl } = useConfig ( ) ;
12
13
13
14
const [ heatMapData , setHeatMapData ] = useState < HeatMapEntry [ ] [ ] > ( [ ] ) ;
14
15
const [ loading , setLoading ] = useState ( false ) ;
@@ -117,18 +118,19 @@ export default function AssetHeatMap() {
117
118
>
118
119
{
119
120
column [ rowIndex ] ?. date ? (
120
- < a
121
- href = { ` ${ exImmichUrl } /search?query=%7B%22takenAfter%22%3A%22 ${ column [ rowIndex ] ?. date ?? "N/A" } T00%3A00%3A00.000Z%22%2C%22takenBefore%22%3A%22 ${ column [ rowIndex ] ?. date ?? "N/A" } T23%3A59%3A59.999Z%22%7D` }
122
- className = "block h-full w-full"
123
- target = "_blank "
124
- >
125
- < div
126
- className = "h-full w-full"
127
- title = { `Date: ${ column [ rowIndex ] ?. date ?? "N/A" } , Count: ${ column [ rowIndex ] ?. count ?? 0 } ` }
128
- />
129
- </ a > ) : < div
121
+ < Tooltip delayDuration = { 0 } content = { `Date: ${ column [ rowIndex ] ?. date ?? "N/A" } - Count: ${ column [ rowIndex ] ?. count ?? 0 } ` } >
122
+ < a
123
+ href = { ` ${ exImmichUrl } /search?query=%7B%22takenAfter%22%3A%22 ${ column [ rowIndex ] ?. date ?? "N/A" } T00%3A00%3A00.000Z%22%2C%22takenBefore%22%3A%22 ${ column [ rowIndex ] ?. date ?? "N/A" } T23%3A59%3A59.999Z%22%7D` }
124
+ className = "block h-full w-full "
125
+ target = "_blank"
126
+ >
127
+ < div
128
+ className = "h-full w-full"
129
+ />
130
+ </ a > </ Tooltip > ) : < div
130
131
className = "h-full w-full"
131
132
/>
133
+
132
134
}
133
135
</ td >
134
136
) ) }
Original file line number Diff line number Diff line change @@ -26,14 +26,22 @@ const TooltipContent = React.forwardRef<
26
26
TooltipContent . displayName = TooltipPrimitive . Content . displayName
27
27
28
28
29
- const Tooltip : React . FC < React . ComponentProps < typeof TooltipRoot > > = ( {
29
+ export interface ITooltipProps extends React . ComponentProps < typeof TooltipRoot > {
30
+ content : string
31
+ }
32
+ const Tooltip : React . FC < ITooltipProps > = ( {
30
33
children,
34
+ content,
31
35
...props
32
36
} ) => (
33
37
< TooltipProvider >
34
38
< TooltipRoot { ...props } >
35
- { children }
36
- < TooltipContent />
39
+ < TooltipTrigger asChild >
40
+ { children }
41
+ </ TooltipTrigger >
42
+ < TooltipContent >
43
+ < p > { content } </ p >
44
+ </ TooltipContent >
37
45
</ TooltipRoot >
38
46
</ TooltipProvider >
39
47
)
You can’t perform that action at this time.
0 commit comments