mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-05 16:04:43 +00:00
Keep translation resources and subscriptions inside each installation. Resolve host labels against the presentation locale so live language changes preserve mounted drafts and RPC state. Existing descriptor types retain string defaults for source compatibility.
28 lines
852 B
TypeScript
28 lines
852 B
TypeScript
import { QueryClientProvider } from "@tanstack/react-query";
|
|
import {
|
|
PaseoApiProvider,
|
|
PluginRpcProvider,
|
|
PluginTranslationProvider,
|
|
} from "@getpaseo/plugin/client/host";
|
|
import React, { type ReactNode } from "react";
|
|
import type { InstalledPlugin } from "./types";
|
|
|
|
/** Every plugin surface renders under its installation: one query cache, one Paseo client, RPCs. */
|
|
export function PluginInstallationProvider({
|
|
plugin,
|
|
children,
|
|
}: {
|
|
plugin: InstalledPlugin;
|
|
children: ReactNode;
|
|
}) {
|
|
return (
|
|
<QueryClientProvider client={plugin.queryClient}>
|
|
<PaseoApiProvider paseo={plugin.paseo}>
|
|
<PluginRpcProvider invoke={plugin.invoke}>
|
|
<PluginTranslationProvider runtime={plugin.i18n}>{children}</PluginTranslationProvider>
|
|
</PluginRpcProvider>
|
|
</PaseoApiProvider>
|
|
</QueryClientProvider>
|
|
);
|
|
}
|