import Typography from '@mui/material/Typography';
import TextField, {TextFieldProps} from '@mui/material/TextField';
import {Box} from '@mui/material';
type Props = TextFieldProps & {
isEditing: boolean;
};
const ProfileField = (props: Props) => {
const {onChange, isEditing, ...inputProps} = props;
const {name, label, value, defaultValue = ''} = inputProps;
if (isEditing) {
return (
onChange(e.target.value)}
id={`Profile${name}`}
{...inputProps}
/>
);
}
return (
{label}
{value || defaultValue}
);
};
export default ProfileField;