'use client'; import { Popover, PopoverButton, PopoverPanel, Transition } from '@headlessui/react'; import { ArrowRightIcon } from '@heroicons/react/16/solid'; import { Menu } from 'lib/shopify/types'; import { Fragment } from 'react'; import OpenProfile from './open-profile'; import { useFormState, useFormStatus } from 'react-dom'; import { doLogin } from 'components/auth/actions'; import { Button } from 'components/button'; type ProfilePopoverProps = { menu: Menu[]; }; function SubmitButton(props: any) { const { pending } = useFormStatus(); return ( <> {props?.message &&
{props?.message}
} ); } const ProfilePopover = ({ menu }: ProfilePopoverProps) => { const [message, formAction] = useFormState(doLogin, null); return (
My Account

{message}

{menu.length ? ( ) : null}
); }; export default ProfilePopover;