chore: improve typings
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
|
||||
import JsonToHtml from "@/components/JsonToHtml"
|
||||
import DynamicContentBlock from "@/components/Loyalty/Blocks/DynamicContent"
|
||||
import Shortcuts from "@/components/MyPages/Blocks/Shortcuts"
|
||||
@@ -10,8 +8,6 @@ import type { BlocksProps } from "@/types/components/loyalty/blocks"
|
||||
import { LoyaltyBlocksTypenameEnum } from "@/types/components/loyalty/enums"
|
||||
|
||||
export async function Blocks({ blocks }: BlocksProps) {
|
||||
const user = await serverClient().user.get()
|
||||
console.log({ user })
|
||||
return blocks.map((block) => {
|
||||
switch (block.__typename) {
|
||||
case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksContent:
|
||||
@@ -24,12 +20,7 @@ export async function Blocks({ blocks }: BlocksProps) {
|
||||
</section>
|
||||
)
|
||||
case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksDynamicContent:
|
||||
return (
|
||||
<DynamicContentBlock
|
||||
dynamicContent={block.dynamic_content}
|
||||
user={user}
|
||||
/>
|
||||
)
|
||||
return <DynamicContentBlock dynamicContent={block.dynamic_content} />
|
||||
case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksShortcuts:
|
||||
return (
|
||||
<Shortcuts
|
||||
|
||||
Reference in New Issue
Block a user