import React from "react"; import { Box, TextField, Typography } from "@mui/material"; import { withI18n } from "../../i18n/withTranslation.js"; const AddressForm = ({ title, address, onChange, errors, namePrefix, t }) => { // Helper function to determine if a required field should show error styling const getRequiredFieldError = (fieldName, value) => { const isEmpty = !value || value.trim() === ""; return isEmpty; }; // Helper function to get label styling for required fields const getRequiredFieldLabelSx = (fieldName, value) => { const showError = getRequiredFieldError(fieldName, value); return showError ? { "&.MuiInputLabel-shrink": { color: "#d32f2f", // Material-UI error color }, } : {}; }; return ( <> {title} ); }; export default withI18n()(AddressForm);