/** * Copyright (c) 2023-present Plane Software, Inc. and contributors * SPDX-License-Identifier: AGPL-3.0-only * See the LICENSE file for details. */ import { Controller, useFormContext } from "react-hook-form"; // plane imports import { NETWORK_CHOICES, ETabIndices } from "@plane/constants"; import { useTranslation } from "@plane/i18n"; import type { IProject } from "@plane/types"; import { SelectionDropdown } from "@/components/common/selection-dropdown"; import { getTabIndex } from "@plane/utils"; // components import { MemberDropdown } from "@/components/dropdowns/member/dropdown"; import { ProjectNetworkIcon } from "@/components/project/project-network-icon"; type Props = { isMobile?: boolean; }; function ProjectAttributes(props: Props) { const { isMobile = false } = props; const { t } = useTranslation(); const { control } = useFormContext(); const { getIndex } = getTabIndex(ETabIndices.PROJECT_CREATE, isMobile); const projectAttributeChipClassName = "nodedc-modal-chip !h-10 !rounded-[1.25rem] !px-4 !py-2 !text-13"; return (
{ const currentNetwork = NETWORK_CHOICES.find((n) => n.key === value); return (
({ key: String(network.key), title: (

{t(network.i18n_label)}

{t(network.description)}

), isChecked: value === network.key, onClick: () => onChange(network.key), }))} menuButton={
{currentNetwork ? ( <> {t(currentNetwork.i18n_label)} ) : ( {t("select_network")} )}
} placement="bottom-start" menuButtonWrapperClassName={projectAttributeChipClassName} tabIndex={getIndex("network")} />
); }} /> { if (value === undefined || value === null || typeof value === "string") return (
onChange(lead === value ? null : lead)} placeholder={t("lead")} multiple={false} buttonVariant="border-with-text" buttonClassName={projectAttributeChipClassName} buttonContainerClassName="!h-10" showUserDetails tabIndex={getIndex("lead")} />
); else return <>; }} />
); } export default ProjectAttributes; export { ProjectAttributes };