1
1
'use client' ;
2
2
3
3
import { Repeat2 , Settings } from 'lucide-react' ;
4
- import React from 'react' ;
4
+ import { useTranslations } from 'next-intl' ;
5
+ import React , { useState } from 'react' ;
5
6
6
7
import { Badge } from '@o2s/ui/components/badge' ;
7
8
import { Button } from '@o2s/ui/components/button' ;
8
9
import { Separator } from '@o2s/ui/components/separator' ;
9
10
import { TextItem } from '@o2s/ui/components/text-item' ;
11
+ import { Tooltip , TooltipContent , TooltipTrigger } from '@o2s/ui/components/tooltip' ;
10
12
import { Typography } from '@o2s/ui/components/typography' ;
11
13
12
14
import { statusBadgeVariants } from '@/utils/mappings/services-badge' ;
@@ -20,6 +22,10 @@ import { ServiceDetailsPureProps } from './ServiceDetails.types';
20
22
export const ServiceDetailsPure : React . FC < ServiceDetailsPureProps > = ( { ...component } ) => {
21
23
const { data : service } = component ;
22
24
25
+ const t = useTranslations ( ) ;
26
+ const [ isSettingsTooltipOpen , setIsSettingsTooltipOpen ] = useState ( false ) ;
27
+ const [ isRenewTooltipOpen , setIsRenewTooltipOpen ] = useState ( false ) ;
28
+
23
29
return (
24
30
< div className = "w-full" >
25
31
< div className = "flex flex-col gap-6" >
@@ -39,17 +45,31 @@ export const ServiceDetailsPure: React.FC<ServiceDetailsPureProps> = ({ ...compo
39
45
< Price price = { service . price . value } />
40
46
</ Typography >
41
47
42
- < Button onClick = { ( ) => console . log ( 'settings' ) } >
43
- < Settings className = "w-4 h-4" />
44
- { service . labels . settings }
45
- </ Button >
48
+ < Tooltip open = { isSettingsTooltipOpen } onOpenChange = { setIsSettingsTooltipOpen } >
49
+ < TooltipTrigger asChild >
50
+ < Button onClick = { ( ) => setIsSettingsTooltipOpen ( true ) } >
51
+ < Settings className = "w-4 h-4" />
52
+ { service . labels . settings }
53
+ </ Button >
54
+ </ TooltipTrigger >
55
+ < TooltipContent >
56
+ < p > { t ( 'general.comingSoon' ) } </ p >
57
+ </ TooltipContent >
58
+ </ Tooltip >
46
59
47
60
{ service . status . value === 'INACTIVE' ||
48
61
( service . status . value === 'EXPIRED' && (
49
- < Button variant = "destructive" onClick = { ( ) => console . log ( 'renew' ) } >
50
- < Repeat2 className = "w-4 h-4" />
51
- { service . labels . renew }
52
- </ Button >
62
+ < Tooltip open = { isRenewTooltipOpen } onOpenChange = { setIsRenewTooltipOpen } >
63
+ < TooltipTrigger asChild >
64
+ < Button variant = "destructive" onClick = { ( ) => setIsRenewTooltipOpen ( true ) } >
65
+ < Repeat2 className = "w-4 h-4" />
66
+ { service . labels . renew }
67
+ </ Button >
68
+ </ TooltipTrigger >
69
+ < TooltipContent >
70
+ < p > { t ( 'general.comingSoon' ) } </ p >
71
+ </ TooltipContent >
72
+ </ Tooltip >
53
73
) ) }
54
74
</ div >
55
75
</ div >
0 commit comments