Add AccountCreation component and product list functionality; update routing and translations
This commit is contained in:
33
src/components/FormField.jsx
Normal file
33
src/components/FormField.jsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import PropTypes from "prop-types";
|
||||
import { motion } from "motion/react";
|
||||
|
||||
function FormField({ label, children, icon }) {
|
||||
return (
|
||||
<div className="flex">
|
||||
<label className="mr-4 text-lg text-black dark:text-primary-dark w-[17%]">
|
||||
{label}
|
||||
</label>
|
||||
<div className="flex w-full gap-4 items-center">
|
||||
{children}
|
||||
{icon && (
|
||||
<motion.div
|
||||
whileHover={{ scale: 1.1 }}
|
||||
whileTap={{ scale: 0.9 }}
|
||||
className="bg-primary rounded-full p-2 text-white cursor-pointer"
|
||||
>
|
||||
{icon}
|
||||
</motion.div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
FormField.propTypes = {
|
||||
label: PropTypes.string.isRequired,
|
||||
children: PropTypes.node.isRequired,
|
||||
icon: PropTypes.node,
|
||||
};
|
||||
|
||||
export default FormField;
|
||||
Reference in New Issue
Block a user