11'use client'
22
3- import { Button } from '@/components/mdx'
4- import { ChevronRight } from 'lucide-react'
3+ import SyntaxUIProBanner from '@/components/SyntaxUIProBanner'
4+ import { useProBannerStore } from '@/store'
5+ import { X } from 'lucide-react'
56import { ThemeProvider } from 'next-themes'
6- import { useRouter } from 'next/navigation'
77
88import posthog from 'posthog-js'
99import { PostHogProvider } from 'posthog-js/react'
@@ -17,26 +17,9 @@ function CSPostHogProvider({ children }: { children: React.ReactNode }) {
1717 return < PostHogProvider client = { posthog } > { children } </ PostHogProvider >
1818}
1919
20- const SyntaxUIProBanner = ( ) => {
21- const router = useRouter ( )
22- return (
23- < >
24- < div
25- onClick = { ( ) => router . push ( '/pro' ) }
26- className = { `fixed bottom-0 left-0 right-0 z-50 cursor-pointer transition-all duration-300 ease-in-out` }
27- >
28- < div className = "flex w-full items-center justify-center gap-x-6 bg-red-500 px-6 py-2 sm:px-3.5" >
29- < div className = "flex items-center gap-4 text-sm font-medium leading-6 text-white" >
30- < p > { `Get Premium Blocks and Templates for your next project on SyntaxUI Pro` } </ p >
31- < ChevronRight className = "h-4 w-4" />
32- </ div >
33- </ div >
34- </ div >
35- </ >
36- )
37- }
38-
3920export function Providers ( { children } : { children : React . ReactNode } ) {
21+ const { showProBanner } = useProBannerStore ( )
22+
4023 return (
4124 < ThemeProvider
4225 attribute = "class"
@@ -45,7 +28,7 @@ export function Providers({ children }: { children: React.ReactNode }) {
4528 >
4629 < CSPostHogProvider >
4730 { children }
48- < SyntaxUIProBanner />
31+ { showProBanner && < SyntaxUIProBanner /> }
4932 </ CSPostHogProvider >
5033 </ ThemeProvider >
5134 )
0 commit comments