File size: 1,443 Bytes
88d205f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
Export Manager Component

This module provides the UI component for exporting the code review results in various formats.
"""

import gradio as gr
import logging

logger = logging.getLogger(__name__)


def create_export_manager():
    """
    Create the export manager component.
    
    Returns:
        list: A list of tuples containing (export_button, export_format).
    """
    export_buttons = []
    export_formats = []
    
    with gr.Group():
        gr.Markdown("### 📤 Export Results")
        
        with gr.Row():
            # JSON Export
            json_btn = gr.Button("Export as JSON", variant="secondary")
            json_format = gr.Textbox(value="json", visible=False)
            export_buttons.append((json_btn, json_format))
            export_formats.append(json_format)
            
            # HTML Export
            html_btn = gr.Button("Export as HTML", variant="secondary")
            html_format = gr.Textbox(value="html", visible=False)
            export_buttons.append((html_btn, html_format))
            export_formats.append(html_format)
            
            # CSV Export
            csv_btn = gr.Button("Export as CSV", variant="secondary")
            csv_format = gr.Textbox(value="csv", visible=False)
            export_buttons.append((csv_btn, csv_format))
            export_formats.append(csv_format)
    
    return export_buttons