Merged in feat/sw-3125-move-client-trpc-setup (pull request #2493)
feat(SW-3125): Move client trpc setup * Move client trpc to package * Client setup in partner-sas * Add todo Approved-by: Linus Flood
This commit is contained in:
20
apps/partner-sas/app/ClientComponent.tsx
Normal file
20
apps/partner-sas/app/ClientComponent.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
/* eslint-disable formatjs/no-literal-string-in-jsx */
|
||||
"use client"
|
||||
import { Lang } from "@scandic-hotels/common/constants/language"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
export function ClientComponent() {
|
||||
const { data, isLoading } = trpc.autocomplete.destinations.useQuery({
|
||||
lang: Lang.en,
|
||||
includeTypes: ["hotels"],
|
||||
query: "Malmö",
|
||||
})
|
||||
|
||||
return (
|
||||
<div>
|
||||
<p>client component</p>
|
||||
<p>Data: {JSON.stringify(data?.hits?.hotels[0]?.name)}</p>
|
||||
<p>Is loading: {isLoading ? "Yes" : "No"}</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user