tetrons 2.3.65 → 2.3.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@ import {
6
6
  EditorContent as TiptapEditorContent,
7
7
  } from "@tiptap/react";
8
8
 
9
+ import { getEnv } from "../../utils/getEnv";
9
10
  import Document from "@tiptap/extension-document";
10
11
  import Paragraph from "@tiptap/extension-paragraph";
11
12
  import Text from "@tiptap/extension-text";
@@ -75,25 +76,10 @@ export default function EditorContent({ apiKey }: EditorContentProps) {
75
76
 
76
77
  const wrapperRef = useRef<HTMLDivElement>(null);
77
78
 
78
- function getApiBaseUrl(): string {
79
- if (
80
- typeof import.meta !== "undefined" &&
81
- import.meta.env?.VITE_TETRONS_API_URL
82
- ) {
83
- return import.meta.env.VITE_TETRONS_API_URL;
84
- }
85
-
86
- if (
87
- typeof process !== "undefined" &&
88
- process.env?.NEXT_PUBLIC_TETRONS_API_URL
89
- ) {
90
- return process.env.NEXT_PUBLIC_TETRONS_API_URL;
91
- }
92
-
93
- return "https://staging.tetrons.com";
94
- }
95
-
96
- const API_BASE_URL = getApiBaseUrl();
79
+ const API_BASE_URL = getEnv(
80
+ "VITE_TETRONS_API_URL",
81
+ "https://staging.tetrons.com"
82
+ );
97
83
 
98
84
  useEffect(() => {
99
85
  const validateKey = async () => {