feat(SW-3125): Move client trpc setup * Move client trpc to package * Client setup in partner-sas * Add todo Approved-by: Linus Flood
21 lines
554 B
TypeScript
21 lines
554 B
TypeScript
/* 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>
|
|
)
|
|
}
|