import React, { useEffect, useState } from 'react'; import type { ReactElement } from 'react'; import Head from 'next/head'; import BaseButton from '../components/BaseButton'; import CardBox from '../components/CardBox'; import BaseIcon from "../components/BaseIcon"; import { mdiInformation, mdiEye, mdiEyeOff } from '@mdi/js'; import SectionFullScreen from '../components/SectionFullScreen'; import LayoutGuest from '../layouts/Guest'; import { Field, Form, Formik } from 'formik'; import FormField from '../components/FormField'; import FormCheckRadio from '../components/FormCheckRadio'; import BaseDivider from '../components/BaseDivider'; import BaseButtons from '../components/BaseButtons'; import { useRouter } from 'next/router'; import { getPageTitle } from '../config'; import { findMe, loginUser, resetAction } from '../stores/authSlice'; import { useAppDispatch, useAppSelector } from '../stores/hooks'; import Link from 'next/link'; import {toast, ToastContainer} from "react-toastify"; import { getPexelsImage } from '../helpers/pexels' export default function Login() { const router = useRouter(); const dispatch = useAppDispatch(); const textColor = useAppSelector((state) => state.style.linkColor); const iconsColor = useAppSelector((state) => state.style.iconsColor); const notify = (type, msg) => toast(msg, { type }); const [ illustrationImage, setIllustrationImage ] = useState({ src: undefined, photographer: undefined, photographer_url: undefined, }) const [contentPosition] = useState<'left' | 'right' | 'background'>('left'); const [showPassword, setShowPassword] = useState(false); const { currentUser, isFetching, errorMessage, token, notify:notifyState } = useAppSelector( (state) => state.auth, ); const [initialValues, setInitialValues] = React.useState({ email:'admin@flatlogic.com', password: 'fc6e39e3', remember: true }) const title = 'Review Flow' const appHighlights = [ 'Automated review requests after payments, jobs, or service milestones.', 'Customer, business, transaction, and delivery follow-up data in one admin workspace.', 'Dashboards, CRM records, payment events, email logs, and admin controls already built in.', ]; const competitorAdvantages = [ { title: 'Built around review operations', description: 'Review Flow combines CRM records, payments, follow-up, review requests, and reputation workflows in one focused system.', }, { title: 'Designed for logistics teams', description: 'Transportation teams can manage businesses, customers, transactions, payment events, and review requests without jumping tools.', }, { title: 'More value in the base plan', description: 'The $65 Base plan includes review automation, widgets, social proof, analytics, AI replies, referrals, and the app tools already available.', }, ]; const pricingPlans = [ { name: 'Base', price: '$65', description: 'Best for businesses that want full review growth tools plus the core Review Flow admin system.', sections: [ { title: 'Review automation', features: [ 'Automate review requests and follow-up reminders.', 'Manually send review requests.', 'Personalize review request SMS and email messaging.', 'Personalize review invite links.', 'Monitor reviews across the web.', 'New review notifications and opportunities reports.', ], }, { title: 'Widgets, referrals, and social proof', features: [ 'Showcase reviews on your website with social proof widgets.', 'Collect reviews and leads with widgets for your website.', 'Microsite that showcases your reviews and generates leads.', 'Automate sharing of reviews to your social media accounts.', 'Share referral link on social media.', ], }, { title: 'Insights, AI, and team motivation', features: [ 'Easily respond to customer reviews with AI-generated replies.', 'Gain review insights and trending topics.', 'Campaign insights and analytics.', 'Encourage friendly competition with staff leaderboards.', 'Connect to 1000s of business apps.', ], }, { title: 'Existing Review Flow tools included', features: [ 'Review Flow workspace for creating, scheduling, and tracking review requests.', 'Business, customer, transaction, and delivery follow-up records.', 'Webhook connectors for Stripe, PayPal, Square, Shopify, and WooCommerce workflows.', 'Payment events, email delivery logs, and cron run monitoring.', 'Admin dashboard with users, roles, permissions, profile, and API documentation access.', ], }, ], }, { name: 'Pro', price: '$99', description: 'Best for growing teams that want every Base feature plus booking, referral, gifting, competitor, and advanced AI tools.', sections: [ { title: 'Everything in Base', features: [ 'Includes all Base review automation, widgets, referrals, analytics, AI replies, social sharing, integrations, and existing app tools.', 'Advanced workflow management.', 'Priority setup support.', ], }, { title: 'Booking reminders', features: [ 'Automate repeat booking reminders and follow-ups.', 'Personalize booking reminder SMS and email messaging.', ], }, { title: 'Referral automation', features: [ 'Automate customer referral requests and follow-ups.', 'Personalize referral request SMS and email messaging.', 'Personalize referral invite links.', ], }, { title: 'Gifting and loyalty', features: [ 'Delight your loyal customers with gift automations.', 'Automate gifting for new customers.', ], }, { title: 'Competitor intelligence and advanced feedback', features: [ 'Gain competitor review and SEO insights.', 'Track competitor topics and gain valuable competitive intel.', 'Competitor topic insights include topics for your business.', 'Automate review replies with AI.', 'Collect deeper, more actionable customer feedback with NPS Surveys.', ], }, ], }, ]; // Fetch Pexels image useEffect( () => { async function fetchData() { const image = await getPexelsImage() setIllustrationImage(image); } fetchData(); }, []); // Fetch user data useEffect(() => { if (token) { dispatch(findMe()); } }, [token, dispatch]); // Redirect to dashboard if user is logged in useEffect(() => { if (currentUser?.id) { router.push('/dashboard'); } }, [currentUser?.id, router]); // Show error message if there is one useEffect(() => { if (errorMessage){ notify('error', errorMessage) } }, [errorMessage]) // Show notification if there is one useEffect(() => { if (notifyState?.showNotification) { notify('success', notifyState?.textNotification) dispatch(resetAction()); } }, [notifyState?.showNotification]) const togglePasswordVisibility = () => { setShowPassword(!showPassword); }; const handleSubmit = async (value) => { const {remember, ...rest} = value await dispatch(loginUser(rest)); }; const setLogin = (target: HTMLElement) => { setInitialValues(prev => ({ ...prev, email : target.innerText.trim(), password: target.dataset.password ?? '', })); }; const imageBlock = (image) => (
Photo by {image?.photographer} on Pexels
) return (
{getPageTitle('Login')}
{contentPosition !== 'background' ? imageBlock(illustrationImage) : null}

{title}

Use{' '} setLogin(e.target)}>admin@flatlogic.com{' / '} fc6e39e3{' / '} to login as Admin

Use setLogin(e.target)}>client@hello.com{' / '} 874c3b951385{' / '} to login as User

handleSubmit(values)} >
Forgot password?

Don’t have an account yet?{' '} New Account

About Us

Review management built for transportation teams.

Review Flow helps logistics and transportation businesses turn completed jobs, payments, and customer interactions into organized review requests. Your team can manage customer records, monitor follow-up, and keep reputation-building work moving from one secure admin panel.

{appHighlights.map((highlight) => (
{highlight}
))}

Why we're better

{competitorAdvantages.map((item) => (
{item.title}

{item.description}

))}

Pricing

Simple monthly plans

Upgrade when your review workflow grows.

{pricingPlans.map((plan) => (
{plan.name}

{plan.description}

{plan.price} /month
{plan.sections.map((section) => (
{section.title}
    {section.features.map((feature) => (
  • {feature}
  • ))}
))}
))}

© 2026 {title}. © All rights reserved

Privacy Policy
); } Login.getLayout = function getLayout(page: ReactElement) { return {page}; };