env context and refactor api support different ports

This commit is contained in:
Milo Schwartz
2024-12-12 22:46:58 -05:00
parent d79760dad9
commit d3d2fe398b
35 changed files with 287 additions and 135 deletions

View File

@@ -1,6 +1,6 @@
"use client";
import api from "@app/api";
import { createApiClient } from "@app/api";
import { Avatar, AvatarFallback } from "@app/components/ui/avatar";
import { Button } from "@app/components/ui/button";
import {
@@ -33,6 +33,7 @@ import {
SelectTrigger,
SelectValue,
} from "@app/components/ui/select";
import { useEnvContext } from "@app/hooks/useEnvContext";
import { useToast } from "@app/hooks/useToast";
import { cn, formatAxiosError } from "@app/lib/utils";
import { ListOrgsResponse } from "@server/routers/org";
@@ -55,6 +56,8 @@ export default function Header({ email, orgId, name, orgs }: HeaderProps) {
const router = useRouter();
const api = createApiClient(useEnvContext());
function getInitials() {
if (name) {
const [firstName, lastName] = name.split(" ");