'use strict';

function useAtlantisFormFieldName({ id, nameProp, }) {
    /**
     * Generate a name if one is not supplied. This is used as the HTML
     * `name` attribute for form-control inputs that need a stable
     * identifier; when a consumer supplies `nameProp`, it wins.
     */
    const name = nameProp ? nameProp : `generatedName--${id}`;
    return { name };
}

exports.useAtlantisFormFieldName = useAtlantisFormFieldName;
