11import { AlertCircleFill , CheckCircleFill , X } from "@/ui/shared/icons" ;
2- import { Tooltip , useMediaQuery } from "@dub/ui" ;
2+ import { SimpleTooltipContent , Tooltip , useMediaQuery } from "@dub/ui" ;
33import { LoadingSpinner } from "@dub/ui/icons" ;
4- import { cn , fetcher , isValidUrl as isValidUrlFn } from "@dub/utils" ;
4+ import { fetcher , isValidUrl as isValidUrlFn } from "@dub/utils" ;
55import { AnimatePresence , motion } from "framer-motion" ;
66import { ReactNode , useMemo } from "react" ;
77import { useFormContext } from "react-hook-form" ;
@@ -121,10 +121,10 @@ function LinkCloakingToggleBadge({
121121 icon = {
122122 isLoading ? (
123123 < LoadingSpinner className = "size-3.5" />
124- ) : ! data ? null : data ? .iframeable ? (
124+ ) : ! data ? null : data . iframeable ? (
125125 < CheckCircleFill className = "size-3.5 text-green-500" />
126126 ) : (
127- < AlertCircleFill className = "size-3.5 text-red -500" />
127+ < AlertCircleFill className = "size-3.5 text-amber -500" />
128128 )
129129 }
130130 />
@@ -135,34 +135,26 @@ function LinkCloakingToggleBadge({
135135 return data ? (
136136 < Tooltip
137137 content = {
138- < div
139- className = { cn (
140- "block max-w-lg text-pretty p-4 text-center text-sm text-gray-700" ,
141- {
142- "max-w-sm" : ! data . iframeable ,
143- } ,
144- ) }
145- >
146- { data . iframeable ? (
147- < div className = "grid gap-2" >
148- < div className = "h-[250px] w-[444px] overflow-hidden rounded-lg border border-gray-200" >
149- < iframe
150- src = { url }
151- style = { {
152- zoom : 0.5 ,
153- } }
154- className = "h-[500px] w-[888px]"
155- />
156- </ div >
157- < p > Your link will be successfully cloaked.</ p >
138+ data . iframeable ? (
139+ < div className = "grid max-w-lg gap-2 text-pretty p-4 text-center text-sm text-gray-700" >
140+ < div className = "h-[250px] w-[444px] overflow-hidden rounded-lg border border-gray-200" >
141+ < iframe
142+ src = { url }
143+ style = { {
144+ zoom : 0.5 ,
145+ } }
146+ className = "h-[500px] w-[888px]"
147+ />
158148 </ div >
159- ) : (
160- < span >
161- There are some issues with the link you provided. Please try
162- again.
163- </ span >
164- ) }
165- </ div >
149+ < p > Your link will be successfully cloaked.</ p >
150+ </ div >
151+ ) : (
152+ < SimpleTooltipContent
153+ title = "Your link is not cloakable – make sure you have the right security headers set on your target URL."
154+ cta = "Learn more"
155+ href = "https://dub.co/help/article/link-cloaking#link-cloaking-with-security-headers"
156+ />
157+ )
166158 }
167159 >
168160 < div > { badge } </ div >
0 commit comments