export type FormContent = {
	id: number;
	title: string;
	site: number | null;
	language: number;
	component: string;
	entity: string;
	tags: Array<string>;
	template: TemplateSchema;
	message: string;
	created: Date;
	modified: Date;
	state: FormState;
	thumbnail: string;
	dataLanguages: FormLanguage[];
	canBeTranslated: boolean;
	originalLanguage: number;
	editorID: number;
	formInUse: { page?: number[]; header?: number[]; footer?: number[] } | null;
	deleted: boolean;
};

export type FormLanguage = { id: number; site: number | null; language: number };

export type PutFormParams = {
	formId: string;
	title: string;
	tags: Array<string>;
	template: unknown;
	message: string;
};

export type ListForm = {
	totalItems: number;
	active: number;
	inactive: number;
	items: FormContent[];
};

export type GetFormsParams = {
	query?: string;
	filterQuery?: string;
	page: number;
	itemsPerPage?: number;
	pagination?: boolean;
};

export type TemplateSchema = {
	editorID: number;
	templateType: string;
	parentEditorID: number;
	type: "template";
	[key: string]: any; // TODO: set type
};

export type FormCategory = {
	id: number;
	title: string;
	relatedSiteId: number | null;
	categoryType: string;
	content: { title: string; code: string };
	position: number;
};

export type FormCategoriesList = {
	totalItems: number;
	items: FormCategory[];
};

export type PostFormCategoryParams = {
	categoryType: string;
	content: { title: string; code: string };
	relatedSite: number | null;
};

export type PutFormCategoryParams = {
	content: { title: string; code: string };
};

export type FormCategoriesOrderParams = {
	id: number;
	categoryType: string;
	position: number;
	relatedSite: number | null;
};

export type FormState = "active" | "inactive";
