def preview(file):
    """Render appropiate template with embed flag."""
    file_info = validate_csv(file)
    return render_template(
        'invenio_previewer/csv_bar.html',
        file=file,
        delimiter=file_info['delimiter'],
        encoding=file_info['encoding'],
        js_bundles=current_previewer.js_bundles + ['previewer_csv_js'],
        css_bundles=current_previewer.css_bundles,
    )