@@ -12,6 +12,7 @@ import { useRecentSearches } from '@/hooks/useRecentSearches';
1212import { useDebounce } from '@/hooks/useDebounce' ;
1313import { Footer } from '@/app/components/Footer' ;
1414import InteractiveViewer from '@/components/InteractiveViewer' ;
15+ import DOMPurify from 'dompurify' ;
1516
1617const Icons = {
1718 Github : ( ) => (
@@ -266,11 +267,10 @@ export default function LandingPage() {
266267 type = "submit"
267268 suppressHydrationWarning
268269 disabled = { ! mounted || trimmedUsername . length === 0 }
269- className = { `relative flex min-w-[160px] items-center justify-center gap-2 overflow-hidden rounded-2xl px-6 py-4 text-sm font-semibold transition-all duration-300 transform cursor-pointer hover:scale-[1.02] hover:shadow-lg active:scale-[0.98] disabled:cursor-not-allowed ${
270- mounted && trimmedUsername . length > 0
271- ? 'bg-black text-white hover:bg-zinc-800 dark:bg-white dark:text-black dark:hover:bg-gray-100 shadow-md'
272- : 'bg-gray-100 text-gray-400 dark:bg-white/5 dark:text-white/20'
273- } `}
270+ className = { `relative flex min-w-[160px] items-center justify-center gap-2 overflow-hidden rounded-2xl px-6 py-4 text-sm font-semibold transition-all duration-300 transform cursor-pointer hover:scale-[1.02] hover:shadow-lg active:scale-[0.98] disabled:cursor-not-allowed ${ mounted && trimmedUsername . length > 0
271+ ? 'bg-black text-white hover:bg-zinc-800 dark:bg-white dark:text-black dark:hover:bg-gray-100 shadow-md'
272+ : 'bg-gray-100 text-gray-400 dark:bg-white/5 dark:text-white/20'
273+ } `}
274274 >
275275 < AnimatePresence mode = "wait" >
276276 { copied ? (
@@ -308,11 +308,10 @@ export default function LandingPage() {
308308 addSearch ( trimmedUsername ) ;
309309 }
310310 } }
311- className = { `relative flex min-w-[160px] items-center justify-center gap-2 overflow-hidden rounded-2xl border px-6 py-4 text-sm font-semibold transition-all duration-300 hover:scale-[1.02] hover:shadow-lg active:scale-[0.98] ${
312- mounted && trimmedUsername . length > 0
313- ? 'border-black/10 bg-white text-black hover:bg-gray-50 dark:border-white/10 dark:bg-white/5 dark:text-white dark:hover:bg-white/10 shadow-sm'
314- : 'border-black/5 bg-gray-50 text-gray-400 dark:border-white/5 dark:bg-transparent dark:text-white/20'
315- } `}
311+ className = { `relative flex min-w-[160px] items-center justify-center gap-2 overflow-hidden rounded-2xl border px-6 py-4 text-sm font-semibold transition-all duration-300 hover:scale-[1.02] hover:shadow-lg active:scale-[0.98] ${ mounted && trimmedUsername . length > 0
312+ ? 'border-black/10 bg-white text-black hover:bg-gray-50 dark:border-white/10 dark:bg-white/5 dark:text-white dark:hover:bg-white/10 shadow-sm'
313+ : 'border-black/5 bg-gray-50 text-gray-400 dark:border-white/5 dark:bg-transparent dark:text-white/20'
314+ } `}
316315 >
317316 Watch Dashboard
318317 </ Link >
@@ -393,7 +392,11 @@ export default function LandingPage() {
393392 animate = { { opacity : 1 , scale : 1 } }
394393 transition = { { duration : 0.5 , ease : 'easeOut' } }
395394 className = "cp-svg-container w-full max-w-[700px] drop-shadow-[0_30px_60px_rgba(0,0,0,0.15)] dark:drop-shadow-[0_30px_60px_rgba(0,0,0,0.5)] [&>svg]:w-full [&>svg]:h-auto"
396- dangerouslySetInnerHTML = { { __html : svgContent } }
395+ dangerouslySetInnerHTML = { {
396+ __html : DOMPurify . sanitize ( svgContent , {
397+ USE_PROFILES : { svg : true , html : true } ,
398+ } ) ,
399+ } }
397400 />
398401 ) }
399402 { svgState === 'loaded' && ! svgContent && errorMessage && (
0 commit comments