import json
import os
from werkzeug.utils import secure_filename
from app.forms import *
from PIL import Image
from os import remove, path


class MyBlocs:

    def makeForm(bloc):
        match bloc['type']:
            case 'presentation' :
                form = Accueil()
            case 'text' :
                form = Description()
            case 'external_link':
                form = Lien()
            case 'gallery':
                form = ImageForm()
            case 'contact':
                form = Contact()
            case _:
                form = None
        return form

    def imgForm():
        return ImageForm()

    def newImgForm():
        return ImageUpload()
