class Playbook::PbContact::Contact

def classname

def classname
  generate_classname("pb_contact_kit")
end

def contact_icon

def contact_icon
  case contact_type
  when "cell"
    "mobile"
  when "home"
    "phone"
  when "work"
    "phone-office"
  when "email"
    "envelope"
  when "work-cell"
    "phone-laptop"
  when "wrong-phone"
    "phone-slash"
  when "extension"
    "phone-plus"
  else # "unknown" || "other"
    "phone"
  end
end

def envelope_path

def envelope_path
  "app/pb_kits/playbook/utilities/icons/envelope.svg"
end

def formatted_contact_value

def formatted_contact_value
  if contact_type == "email"
    contact_value
  elsif contact_type == "extension" && contact_value.match(/^\d{4}$/)
    contact_value
  else
    number_to_phone(formatted_value, area_code: true)
  end
end

def formatted_value

def formatted_value
  contact_value.to_s.gsub(/\D/, "")
end