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 customer workspace.', 'Dashboards, CRM records, payment events, email logs, and separate internal 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: 'Clear Starter and Pro tiers', description: 'Starter is $49/month for the core review workflow. Pro is $99/month for higher limits, automation, AI, and reputation marketing tools.', }, ]; const pricingPlans = [ { name: 'Starter', price: '$49', description: 'Best for small teams that need the core Review Flow workflow and simple monthly limits.', sections: [ { title: 'Core review workflow', features: [ 'Review Flow workspace for creating, scheduling, and tracking review requests.', 'Manual review request creation and hosted public review forms.', 'Customer, business, transaction, and delivery follow-up records.', ], }, { title: 'Starter limits', features: [ '250 review requests per month.', '1 business profile.', '2 team members.', 'Stripe, Square, PayPal, Shopify, and WooCommerce webhook intake.', ], }, ], }, { name: 'Pro', price: '$99', description: 'Best for growing teams that want higher limits, automation, AI assistance, and reputation marketing tools.', sections: [ { title: 'Everything in Starter', features: [ '2,500 review requests per month.', '10 business profiles.', '10 team members.', 'Priority support and advanced reporting.', ], }, { title: 'Growth tools', features: [ 'Advanced automation rules.', 'AI review reply assistant.', 'Social proof widgets, referral campaigns, repeat booking reminders, NPS surveys, and broadcasts.', ], }, ], }, ]; // 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 Internal Admin

Use setLogin(e.target)}>john@doe.com{' / '} 874c3b951385{' / '} to login as Customer Owner

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 workspace.

{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}; };