mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-26 14:56:39 +00:00
I18n additionals (#125)
* New translation keys * Updates in src/components * Updates in src/providers * remove lable in selector, not needed --------- Co-authored-by: Lokowitz <marvinlokowitz@gmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import OrgContext from "@app/contexts/orgContext";
|
||||
import { GetOrgResponse } from "@server/routers/org";
|
||||
import { useState } from "react";
|
||||
import { useTranslations } from "next-intl";
|
||||
|
||||
interface OrgProviderProps {
|
||||
children: React.ReactNode;
|
||||
@@ -12,13 +13,15 @@ interface OrgProviderProps {
|
||||
export function OrgProvider({ children, org: serverOrg }: OrgProviderProps) {
|
||||
const [org, setOrg] = useState<GetOrgResponse | null>(serverOrg);
|
||||
|
||||
const t = useTranslations();
|
||||
|
||||
if (!org) {
|
||||
throw new Error("No org provided");
|
||||
throw new Error(t('orgErrorNoProvided'));
|
||||
}
|
||||
|
||||
const updateOrg = (updatedOrg: Partial<GetOrgResponse>) => {
|
||||
if (!org) {
|
||||
throw new Error("No org to update");
|
||||
throw new Error(t('orgErrorNoUpdate'));
|
||||
}
|
||||
|
||||
setOrg((prev) => {
|
||||
|
||||
Reference in New Issue
Block a user