import clsx from "clsx"; import * as React from "react"; import { useTranslation } from "react-i18next"; import { useFetcher } from "react-router"; import { Input } from "~/components/Input"; import { Label } from "~/components/Label"; import { SubmitButton } from "~/components/SubmitButton"; import { FRIEND_CODE_REGEXP_PATTERN } from "~/features/sendouq/q-constants"; import { SENDOUQ_PAGE } from "~/utils/urls"; export function FriendCodeInput({ friendCode, }: { friendCode?: string | null; }) { const fetcher = useFetcher(); const { t } = useTranslation(["common"]); const id = React.useId(); return (
{!friendCode ? ( ) : null} {friendCode ? (
SW-{friendCode}
) : ( )}
{!friendCode ? ( Save ) : null}
); }