#pragma once

#include "CoreMinimal.h"
#include "CoreBaseUserWidget.h"
#include "Templates/SubclassOf.h"
#include "ENewsAndMessagesSectionType.h"
#include "CoreInboxBodySectionWrapperWidget.generated.h"

class UCoreInboxBodySectionBaseWidget;
class UPanelWidget;
class UInboxBodySectionViewData;

UCLASS(Blueprintable, EditInlineNew)
class DBDUIVIEWSCORE_API UCoreInboxBodySectionWrapperWidget : public UCoreBaseUserWidget
{
	GENERATED_BODY()

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	TMap<ENewsAndMessagesSectionType, TSubclassOf<UCoreInboxBodySectionBaseWidget>> SectionClasses;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UPanelWidget* SectionWidgetContainer;

private:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Transient, Export, meta=(AllowPrivateAccess=true))
	UCoreInboxBodySectionBaseWidget* _currentSectionWidget;

public:
	UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
	bool SetData(UInboxBodySectionViewData* viewData);

protected:
	UFUNCTION(BlueprintCallable)
	void DestroyCurrentSection();

	UFUNCTION(BlueprintCallable)
	void CreateSectionOfType(const ENewsAndMessagesSectionType type);

public:
	UCoreInboxBodySectionWrapperWidget();
};

FORCEINLINE uint32 GetTypeHash(const UCoreInboxBodySectionWrapperWidget) { return 0; }
