/**
 * Type → SVG icon URL for the field palette AND the form canvas.
 *
 * Phase 7: icons ride on the field-type registry (each edition registers its
 * own types with their icon URLs), so the Free bundle no longer imports Pro
 * SVG assets or mentions Pro type ids. Unknown (preserved Pro) types fall back
 * to the text icon so they still surface something in the canvas.
 */
import { fieldTypeDef } from "@/admin/fields/type-registry";

/**
 * Resolve a field type to its SVG icon URL.
 *
 * @param {string} type
 * @returns {string} URL string usable in <img src>.
 */
export function iconUrlForType(type) {
    return fieldTypeDef(type)?.icon || fieldTypeDef("text")?.icon || "";
}
