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

Code before:
                      (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}>
                <UnstableDropdownMenuTrigger asChild>
                  <UnstableIconButton
                    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"
                    )}
                  >
                    <EllipsisIcon />
                  </UnstableIconButton>
                </UnstableDropdownMenuTrigger>
                <UnstableDropdownMenuContent align="end">
                  <ProjectPermissionCan
                    I={ProjectPermissionActions.Create}
                    a={subject(ProjectPermissionSub.Secrets, {

Review comment (security):
nit: maybe we could put this in a function ?

something like

```javascript
const getTooltipContentForSecretSharing = () => {
  if (!currentProject.secretSharing) {
     return "Secret Sharing Disabled"
  }

 if (secretValueHidden) {
   return "Access Denied"
  }

 if (isCreatable && !importedSecret) {
   return  "Create Secret to Share"
 }

 return "Share Secret"
}

```

Code after:
                    ? "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"
                        });
                      }
                    }}
                    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>{getTooltipContentForSecretSharing()}</TooltipContent>
              </Tooltip>
              <UnstableDropdownMenu open={isDropdownOpen} onOpenChange={setIsDropdownOpen}>
                <UnstableDropdownMenuTrigger asChild>