"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { Button } from "../ui/button";
import { useTeamsConfig } from "../../hooks/useTeamsConfig";
import { useTeam } from "../../hooks/useTeam";
import { useTranslations } from "next-intl";
import { Plus } from "lucide-react";
function CreateTeamButton({
  onClick,
  children,
  variant = "default",
  size = "default",
  className,
  showIcon = true
}) {
  const t = useTranslations("teams");
  const { canCreate } = useTeamsConfig();
  const { canCurrentUserCreateTeam } = useTeam();
  if (!canCreate) {
    return null;
  }
  if (!canCurrentUserCreateTeam) {
    return null;
  }
  return /* @__PURE__ */ jsxs(
    Button,
    {
      variant,
      size,
      className,
      onClick,
      "data-cy": "create-team-button",
      "aria-label": t("create.createTeam"),
      children: [
        showIcon && /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-2", "aria-hidden": "true" }),
        children || t("create.createTeam")
      ]
    }
  );
}
export {
  CreateTeamButton
};
