<script>
import { PxIconSrcOrAttrs } from '../components/PxIcon.vue';

export default {
    props: {
        /**
         * The icon. If a string is provided, it will be interpreted as the src of the icon. If an
         * object is provided, it will be passed directly to the icon component as props (with a
         * filter applied to ensure no unused attributes get set on the element). See PxIcon for the
         * full list of supported attributes.
         */

        icon: { type: [String, Object], default: null },
    },
    computed: {
        iconAttrs() {
            return PxIconSrcOrAttrs(this.icon);
        },
    },
};
</script>
