30 lines
872 B
TypeScript
30 lines
872 B
TypeScript
/**
|
|
* Constants for contact-related functionality
|
|
* Created: 2025-11-16
|
|
*/
|
|
|
|
/**
|
|
* Contact method types with user-friendly labels
|
|
* Used in: ContactEditView.vue, DIDView.vue
|
|
*/
|
|
export const CONTACT_METHOD_TYPES = [
|
|
{ value: "CELL", label: "Mobile" },
|
|
{ value: "EMAIL", label: "Email" },
|
|
{ value: "WHATSAPP", label: "WhatsApp" },
|
|
] as const;
|
|
|
|
/**
|
|
* Type for contact method type values
|
|
*/
|
|
export type ContactMethodType = (typeof CONTACT_METHOD_TYPES)[number]["value"];
|
|
|
|
/**
|
|
* Helper function to get label for a contact method type
|
|
* @param type - The contact method type value (e.g., "CELL", "EMAIL")
|
|
* @returns The user-friendly label or the original type if not found
|
|
*/
|
|
export function getContactMethodLabel(type: string): string {
|
|
const methodType = CONTACT_METHOD_TYPES.find((m) => m.value === type);
|
|
return methodType ? methodType.label : type;
|
|
}
|