feat: implement dynamic contact info and availability mapping from field values, and enhance phone number masking.

This commit is contained in:
pradeepkumar
2026-02-02 10:19:55 +05:30
parent b5106945dc
commit 1faed9140c
4 changed files with 77 additions and 34 deletions

View File

@@ -134,6 +134,32 @@ export interface ProfileCardData {
state: string | null;
}
// Contact info data structure
export interface ContactInfoData {
email: string | null;
phone: string | null;
}
/**
* Maps field values to contact info data (email, phone)
*/
export function mapFieldValuesToContactInfo(fieldValues: FieldValueResponse[]): ContactInfoData {
// Get phone from various possible field slugs
const phoneNumber = getFieldValue(fieldValues, 'phone_number') as string | undefined;
const phone = getFieldValue(fieldValues, 'phone') as string | undefined;
const cellNumber = getFieldValue(fieldValues, 'cell_number') as string | undefined;
const officeNumber = getFieldValue(fieldValues, 'office_number') as string | undefined;
// Get email from various possible field slugs
const emailField = getFieldValue(fieldValues, 'email') as string | undefined;
const emailAddress = getFieldValue(fieldValues, 'email_address') as string | undefined;
return {
email: emailField || emailAddress || null,
phone: phoneNumber || phone || cellNumber || officeNumber || null,
};
}
// Dynamic field data structure for SpecializationSection component
// Each field within the "Specialization" section becomes a card
export interface SpecializationFieldItem {