feat(SW-2872) Dependency inject app context in trpc package * Move appRouter to trpc package * WIP Move serverClient to trpc package Doesn't handle errors yet * Don't use global * Use trpc everywhere Approved-by: Linus Flood
29 lines
744 B
TypeScript
29 lines
744 B
TypeScript
import { Lang } from "@scandic-hotels/common/constants/language"
|
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
|
|
|
import { env } from "../env/server"
|
|
import { serverClient } from "./trpc"
|
|
|
|
const tempEnv = env.FOO
|
|
|
|
export async function Temp() {
|
|
const caller = await serverClient()
|
|
const destinations = await caller.autocomplete.destinations({
|
|
lang: Lang.en,
|
|
includeTypes: ["hotels"],
|
|
query: "Stockholm",
|
|
})
|
|
const hotel = destinations.hits.hotels[0].name
|
|
|
|
return (
|
|
<div>
|
|
<Typography variant="Body/Lead text">
|
|
<p>Tjena {tempEnv}</p>
|
|
</Typography>
|
|
<Typography variant="Body/Lead text">
|
|
<p>Something fetched by tRPC: {hotel}</p>
|
|
</Typography>
|
|
</div>
|
|
)
|
|
}
|