fix: Ajout du mode Visu

This commit is contained in:
N3WT DE COMPET
2025-05-04 14:32:06 +02:00
parent 4ecf25a6ab
commit e1c607308c
29 changed files with 531 additions and 414 deletions

View File

@ -10,10 +10,10 @@ export default function InputPhone({
errorMsg,
className,
required,
enable = true, // Par défaut, le champ est activé
}) {
const handlePhoneChange = (phone) => {
// Appeler onChange avec un objet personnalisé
if (onChange) {
if (enable && onChange) {
if (phone && phone.target) {
const { name, value } = phone.target;
onChange({ target: { name: name, value: value } });
@ -37,11 +37,20 @@ export default function InputPhone({
inputProps={{
name: name,
required: required,
disabled: !enable, // Désactiver l'input si enable est false
}}
className="!w-full mt-1 !h-[38px]"
containerClassName="!w-full !h-[36px] !flex !items-center !rounded-md"
inputClassName={`flex-1 px-3 py-2 block w-full sm:text-sm border-none focus:ring-0 outline-none !rounded-r-md !outline-none items-center !border !border-gray-200 rounded-md ${errorMsg ? 'border-red-500' : ''} hover:border-gray-400 focus-within:border-gray-500`}
buttonClassName="!h-[38px] !flex !items-center !justify-center !rounded-l-md !border border-gray-200 !border-r-0"
className={`!w-full mt-1 !h-[38px] ${
!enable ? 'bg-gray-100 cursor-not-allowed' : ''
}`}
containerClassName={`!w-full !h-[36px] !flex !items-center !rounded-md ${
!enable ? 'bg-gray-100 cursor-not-allowed' : ''
}`}
inputClassName={`flex-1 px-3 py-2 block w-full sm:text-sm border-none focus:ring-0 outline-none !rounded-r-md items-center !border !border-gray-200 rounded-md ${
errorMsg ? 'border-red-500' : ''
} ${!enable ? 'bg-gray-100 cursor-not-allowed' : 'hover:border-gray-400 focus-within:border-gray-500'}`}
buttonClassName={`!h-[38px] !flex !items-center !justify-center !rounded-l-md !border border-gray-200 !border-r-0 ${
!enable ? 'cursor-not-allowed' : ''
}`}
/>
{errorMsg && <p className="mt-2 text-sm text-red-600">{errorMsg}</p>}