"use client";

import { FeatureGate } from "@/core/feature-flags";
import { useI18n } from "@/core/i18n";
import { ParcelSyncModule } from "@/modules/parcel-sync";

export default function ParcelSyncPage() {
  const { t } = useI18n();

  return (
    <FeatureGate flag="module.parcel-sync" fallback={<ModuleDisabled />}>
      <div className="mx-auto max-w-6xl space-y-6">
        <div>
          <h1 className="text-2xl font-bold tracking-tight">
            {t("parcel-sync.title")}
          </h1>
          <p className="text-muted-foreground">
            {t("parcel-sync.description")}
          </p>
        </div>
        <ParcelSyncModule />
      </div>
    </FeatureGate>
  );
}

function ModuleDisabled() {
  return (
    <div className="mx-auto max-w-6xl py-12 text-center text-muted-foreground">
      <p>Modulul eTerra Parcele este dezactivat.</p>
    </div>
  );
}
