+ {isRegistering ? 'Preencha os campos para começar a divulgar suas promoções' : 'Faça login para continuar'} +
+ + {/* Segmented Buttons */} +Visualizações
+1,204
+arrow_upward+5.2%
+Carregando promoções...
; + } + + if (error) { + returnErro ao carregar promoções: {error}
; + } + + if (promotions.length === 0) { + return ( +Crie sua primeira promoção para atrair estudantes para sua loja!
+ + add_circle + Criar Primeira Promoção + +{promo.title}
++ Ativo - R$ {promo.promotional_price.toFixed(2).replace('.', ',')} +
+= 1 ? 'text-primary' : 'text-text-muted-light dark:text-text-muted-dark'}`}>Passo 1
+= 2 ? 'text-primary' : 'text-text-muted-light dark:text-text-muted-dark'}`}>Passo 2
+= 3 ? 'text-primary' : 'text-text-muted-light dark:text-text-muted-dark'}`}>Passo 3
+Válido até {formData.expirationDate}
+{formData.title || "Título da sua promoção"}
+De R$ {formData.originalPrice || '0,00'}
+Por R$ {formData.promoPrice || '0,00'}
+-{discount}%
+Adicionar imagem da promoção
+Arraste ou clique para enviar
+ + ++ Looking for a starting point or more instructions? Head over to{" "} + + Templates + {" "} + or the{" "} + + Learning + {" "} + center. +
+(WrappedComponent: React.ComponentType
) => { + const WithAuthComponent = (props: P) => { + const router = useRouter(); + const [loading, setLoading] = useState(true); + + useEffect(() => { + const checkUser = async () => { + const { data: { session } } = await supabase.auth.getSession(); + if (!session) { + router.replace('/auth'); + } else { + setLoading(false); + } + }; + + checkUser(); + }, [router]); + + if (loading) { + return
Loading...
; // Or a spinner component + } + + return