/* ============================================================
IKON SOSIAL MEDIA — dipakai bersama oleh situs utama
(cv-components.jsx) dan editor (cv-editor.jsx).
Muat file ini SEBELUM kedua file tersebut.
============================================================ */
/* Daftar platform untuk pemilih ikon di editor. */
const SOCIAL_PLATFORMS = [
{ key: "email", label: "Email" },
{ key: "instagram", label: "Instagram" },
{ key: "tiktok", label: "TikTok" },
{ key: "youtube", label: "YouTube" },
{ key: "whatsapp", label: "WhatsApp" },
{ key: "facebook", label: "Facebook" },
{ key: "x", label: "X (Twitter)" },
{ key: "linkedin", label: "LinkedIn" },
{ key: "telegram", label: "Telegram" },
{ key: "website", label: "Website" },
];
/* Tebak ikon dari teks jenis (cadangan kalau channel belum punya field icon). */
function iconKindFromType(type) {
const x = String(type || "").toLowerCase();
if (x.indexOf("insta") >= 0) return "instagram";
if (x.indexOf("tik") >= 0) return "tiktok";
if (x.indexOf("you") >= 0) return "youtube";
if (x.indexOf("whats") >= 0) return "whatsapp";
if (x.indexOf("face") >= 0 || x === "fb") return "facebook";
if (x.indexOf("linkedin") >= 0) return "linkedin";
if (x.indexOf("telegram") >= 0 || x.indexOf("tele") >= 0) return "telegram";
if (x.indexOf("twitter") >= 0 || x === "x") return "x";
if (x.indexOf("mail") >= 0 || x.indexOf("email") >= 0) return "email";
if (x.indexOf("web") >= 0 || x.indexOf("situs") >= 0 || x.indexOf("link") >= 0) return "website";
return "website";
}
/* Komponen ikon. Logo brand digambar sebagai glyph terisi (fill). */
function ContactIcon({ kind }) {
const F = { viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true" };
const L = { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.9,
strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true" };
switch (kind) {
case "email":
return ();
case "instagram":
return ();
case "tiktok":
return ();
case "youtube":
return ();
case "whatsapp":
return ();
case "facebook":
return ();
case "x":
return ();
case "linkedin":
return ();
case "telegram":
return ();
case "website":
default:
return ();
}
}
Object.assign(window, { SOCIAL_PLATFORMS, iconKindFromType, ContactIcon });