@@ -3,7 +3,7 @@ import ReactDOM from 'react-dom'; // Import ReactDOM
33import { CaretDown , Check } from '@phosphor-icons/react' ;
44import { motion , AnimatePresence } from 'framer-motion' ;
55
6- const CustomDropdown = ( { options, value, onChange, icon : Icon , label } ) => {
6+ const CustomDropdown = ( { options, value, onChange, icon : Icon , label, className = '' } ) => {
77 const [ isOpen , setIsOpen ] = useState ( false ) ;
88 const dropdownRef = useRef ( null ) ; // Ref for the button
99 const menuRef = useRef ( null ) ; // Ref for the dropdown menu
@@ -89,15 +89,17 @@ const CustomDropdown = ({ options, value, onChange, icon: Icon, label }) => {
8989 } ;
9090
9191 return (
92- < div className = " relative inline-block text-left" >
92+ < div className = { ` relative inline-block text-left ${ className } ` } >
9393 < button
9494 type = "button"
9595 ref = { dropdownRef } // Attach ref to the button
9696 onClick = { ( ) => setIsOpen ( ! isOpen ) }
97- className = "flex items-center gap-2 px-4 py-2 bg-gray-800 hover:bg-gray-700 border border-gray-700 rounded-md text-sm font-medium text-gray-200 transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-900 focus:ring-primary-500"
97+ className = "flex items-center justify-between w-full gap-2 px-4 py-2 bg-gray-800 hover:bg-gray-700 border border-gray-700 rounded-md text-sm font-medium text-gray-200 transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-900 focus:ring-primary-500"
9898 >
99- { Icon && < Icon size = { 20 } className = "text-gray-400" /> }
100- < span > { selectedOption ? selectedOption . label : label } </ span >
99+ < div className = "flex items-center gap-2" >
100+ { Icon && < Icon size = { 20 } className = "text-gray-400" /> }
101+ < span > { selectedOption ? selectedOption . label : label } </ span >
102+ </ div >
101103 < CaretDown
102104 size = { 16 }
103105 className = { `ml-2 transition-transform duration-200 ${ isOpen ? 'rotate-180' : '' } ` }
0 commit comments