diff --git a/src/pages/contact/component/DetailContact.jsx b/src/pages/contact/component/DetailContact.jsx index f35fa09..6918f20 100644 --- a/src/pages/contact/component/DetailContact.jsx +++ b/src/pages/contact/component/DetailContact.jsx @@ -59,6 +59,17 @@ const DetailContact = memo(function DetailContact(props) { const handleSave = async () => { setConfirmLoading(true); + // Custom validation untuk name - minimal 3 karakter + if (formData.name && formData.name.length < 3) { + NotifOk({ + icon: 'warning', + title: 'Peringatan', + message: 'Nama contact minimal 3 karakter', + }); + setConfirmLoading(false); + return; + } + // Custom validation untuk phone - Indonesian phone format const phoneRegex = /^(?:\+62|0)8\d{7,10}$/; if (formData.phone && !phoneRegex.test(formData.phone.replace(/[\s\-\(\)]/g, ''))) { diff --git a/src/pages/contact/component/ListContact.jsx b/src/pages/contact/component/ListContact.jsx index 373edde..f6ff048 100644 --- a/src/pages/contact/component/ListContact.jsx +++ b/src/pages/contact/component/ListContact.jsx @@ -43,6 +43,22 @@ const ContactCard = memo(function ContactCard({ contact, showEditModal, showDele position: 'relative', }} > + {/* Type Badge - Top Left */} +