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

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

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

import { SummaryEventsExtraProperties } from "./SummaryEventsExtraProperties";
import { SummaryEventsReportDetails } from "./SummaryEventsReportDetails";

export class SummaryEventsReportBuilder implements BaseReportBuilder {
	public getTitle(): string | null {
		return t("Сводный отчет по тревогам");
	}

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

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

	public getOptions = () => ({
		useExcelExport: false,
		usePdfExport: true,
	});

	public useDateRange(): boolean {
		return true;
	}

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