//===========================================
// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template
//===========================================
import { yupResolver } from "@hookform/resolvers/yup";
import { KnownErrors } from "@hexclave/shared/dist/known-errors";
import { strictEmailSchema, yupObject } from "@hexclave/shared/dist/schema-fields";
import { runAsynchronously } from "@hexclave/shared/dist/utils/promises";
import { ActionCell, Badge, Button, Input, Table, TableBody, TableCell, TableRow, Typography } from "@hexclave/ui";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import * as yup from "yup";
import { FormWarningText } from "../../../components/elements/form-warning";
import { useUser } from "../../../lib/hooks";
import { useTranslation } from "../../../lib/translations";
export function EmailsSection(props?: {
mockMode?: boolean,
}) {
const { t } = useTranslation();
const user = useUser({ or: props?.mockMode ? 'return-null' : 'redirect' });
// In mock mode, show a placeholder message
if (props?.mockMode && !user) {
return (
{t("Emails")}
{t("Email management is not available in demo mode.")}