Replace social media list with icons

<?php

add_filter( 'facetwp_builder_item_value', function( $value, $item ) {
    if ( 'social-icons' == $item['settings']['name'] ) {
        $output = '';
        $names = explode( ', ', $value ); // get the individual names
        $names = array_map( 'strtolower', $names ); // convert to lowercase
        foreach ( $names as $name ) {
            $output .= '<img src="/path/to/' . $name . '.jpg" alt="' . $name . '" /> ';
        }
        return $output;
    }
    return $value;
}, 10, 2 );