"use client";

import Link from "next/link";
import type { ReactElement } from "react";
import { useTranslation } from "react-i18next";

import { AdminNoResourceState } from "@/components/admin/admin-no-resource-state";
import { Button } from "@/components/ui/button";

export function AdminNoIntegrationSiteState({
  canCreate = false,
}: {
  canCreate?: boolean;
}): ReactElement {
  const { t } = useTranslation("common");

  return (
    <AdminNoResourceState message={t("integrationSites.emptyPlatformHint")}>
      {canCreate ? (
        <Button nativeButton={false} size="sm" render={<Link href="/admin/config/integration-sites" />}>
          {t("integrationSites.createSite")}
        </Button>
      ) : null}
    </AdminNoResourceState>
  );
}
