Repository: Infisical/infisical
File: frontend/src/pages/secret-manager/OverviewPage/components/SecretTableRow/SecretEditTableRow.tsx (TypeScript)

Code before:
                    ? "Cannot Edit Multi-line Encoding on Imported Secret"
                    : isCreatable
                      ? "Create Secret to Edit Multi-line Encoding"
                      : !canEditSecretValue
                        ? "Access Denied"
                        : skipMultilineEncoding
                          ? "Disable Multi-line Encoding"
                          : "Enable Multi-line Encoding"}
                </TooltipContent>
              </Tooltip>
              <Tooltip delayDuration={300} disableHoverableContent>
                <TooltipTrigger>
                  <UnstableIconButton
                    isDisabled={
                      secretValueHidden ||
                      !currentProject.secretSharing ||
                      (isCreatable && !isImportedSecret)
                    }
                    onClick={async () => {
                      if (sharedValueData) {
                        handlePopUpOpen("createSharedSecret", {
                          value: sharedValueData.value
                        });
                        return;
                      }
                      const { data } = await refetchSharedValue();
                      if (data) {
                        handlePopUpOpen("createSharedSecret", { value: data.value });
                      }
                    }}
                    variant="ghost"
                    size="xs"
                    className={twMerge(
                      "w-0 overflow-hidden border-0 opacity-0 group-hover:w-7 group-hover:opacity-100",
                      shouldStayExpanded && "w-7 opacity-100"
                    )}
                  >
                    <ForwardIcon />
                  </UnstableIconButton>
                </TooltipTrigger>
                <TooltipContent>
                  {!currentProject.secretSharing
                    ? "Secret Sharing Disabled"
                    : secretValueHidden
                      ? "Access Denied"
                      : isCreatable && !importedSecret
                        ? "Create Secret to Share"
                        : "Share Secret"}
                </TooltipContent>
              </Tooltip>
              <UnstableDropdownMenu open={isDropdownOpen} onOpenChange={setIsDropdownOpen}>

Review comment (suggestion):
might be worth treating errors here ..
unsure if throwing an error on this onClick could break the interface (will test this scenario)

Code after:
                      isCreatable || isImportedSecret || !canEditSecretValue || isUpdatingMultiline
                    }
                    onClick={handleToggleMultilineEncoding}
                    className={twMerge(
                      skipMultilineEncoding && !isImportedSecret
                        ? "w-7 text-project opacity-100"
                        : "w-0 opacity-0",
                      "overflow-hidden border-0 group-hover:w-7 group-hover:opacity-100",
                      shouldStayExpanded && "w-7 opacity-100"
                    )}
                  >
                    <WrapTextIcon />
                  </UnstableIconButton>
                </TooltipTrigger>
                <TooltipContent>
                  {isImportedSecret
                    ? "Cannot Edit Multi-line Encoding on Imported Secret"
                    : isCreatable
                      ? "Create Secret to Edit Multi-line Encoding"
                      : !canEditSecretValue
                        ? "Access Denied"
                        : skipMultilineEncoding
                          ? "Disable Multi-line Encoding"
                          : "Enable Multi-line Encoding"}
                </TooltipContent>
              </Tooltip>
              <Tooltip delayDuration={300} disableHoverableContent>
                <TooltipTrigger>
                  <UnstableIconButton
                    isDisabled={
                      secretValueHidden ||
                      !currentProject.secretSharing ||
                      (isCreatable && !isImportedSecret)
                    }
                    onClick={async () => {
                      if (sharedValueData) {
                        handlePopUpOpen("createSharedSecret", {
                          value: sharedValueData.value
                        });
                        return;
                      }

                      const { data, error } = await refetchSharedValue();
                      if (data) {
                        handlePopUpOpen("createSharedSecret", { value: data.value });
                      } else {
                        createNotification({
                          type: "error",
                          title: "Failed to fetch secret value",
                          text: (error as Error)?.message ?? "Please try again later"
                        });