import tkinter as tk
import threading
from app import scraping

class PanelIzquierdo:
    def __init__(self, frame, text_widget):
        # Asociar el frame del panel izquierdo
        self.frame = frame
        self.frame.configure(bg="lightblue", width=200)
        self.frame.grid_propagate(False)
        self.frame.columnconfigure(0, weight=1)
        
        boton_scrapping = tk.Button(
            frame,
            text="Iniciar Scrapping",
            command=lambda: threading.Thread(
                target=scraping.iniciar_scraping_y_insercion, 
                args=("https://www.amazon.es/", text_widget) 
            ).start()
        )
        boton_scrapping.pack(pady=5)