import { t } from "i18next";
import { ReactNode } from "react";

import { ReportType } from "@/contracts/client.schemas";

import { BaseReportBuilder } from "../BaseReportBuilder";
import { BuilderOptions } from "../BuilderOptions";
import { Report } from "../models/Report";

import { ByStateReportDetails } from "./ByStateReportDetails";
import { ByStateReportProperties } from "./ByStateReportProperties";

export class ByStateReportBuilder implements BaseReportBuilder {
	public getTitle(): string | null {
		return t("reportByObjectState");
	}

	public getOptions(): BuilderOptions {
		return {
			useExcelExport: true,
			usePdfExport: true,
		};
	}

	public renderDetails(container: Report): ReactNode | null {
		return <ByStateReportDetails report={container} />;
	}

	public getType(): ReportType {
		return ReportType.ByState;
	}

	public useDateRange(): boolean {
		return false;
	}

	public renderExtraProperties(): ReactNode | null {
		return <ByStateReportProperties />;
	}
}
