chore: fix type check for i18n (#30058)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
This commit is contained in:
Stephen Zhou
2025-12-24 16:31:16 +08:00
committed by GitHub
parent 0f41924db4
commit 1e3823e605
155 changed files with 560 additions and 1015 deletions

View File

@ -85,7 +85,7 @@ const Blocks = ({
{
classification !== '-' && !!filteredList.length && (
<div className="flex h-[22px] items-start px-3 text-xs font-medium text-text-tertiary">
{t(`workflow.tabs.${classification}`)}
{t(`workflow.tabs.${classification}` as any) as string}
</div>
)
}

View File

@ -2,6 +2,7 @@
import type { ToolWithProvider } from '../types'
import type { ToolDefaultValue, ToolValue } from './types'
import type { Plugin } from '@/app/components/plugins/types'
import type { Locale } from '@/i18n-config'
import { RiMoreLine } from '@remixicon/react'
import Link from 'next/link'
import { useEffect, useMemo, useState } from 'react'
@ -178,7 +179,7 @@ const FeaturedTools = ({
onInstallSuccess={async () => {
await onInstallSuccess?.()
}}
t={t}
t={t as any}
/>
))}
</div>
@ -221,7 +222,7 @@ const FeaturedTools = ({
type FeaturedToolUninstalledItemProps = {
plugin: Plugin
language: string
language: Locale
onInstallSuccess?: () => Promise<void> | void
t: (key: string, options?: Record<string, any>) => string
}

View File

@ -1,6 +1,7 @@
'use client'
import type { TriggerDefaultValue, TriggerWithProvider } from './types'
import type { Plugin } from '@/app/components/plugins/types'
import type { Locale } from '@/i18n-config'
import { RiMoreLine } from '@remixicon/react'
import Link from 'next/link'
import { useEffect, useMemo, useState } from 'react'
@ -170,7 +171,7 @@ const FeaturedTriggers = ({
onInstallSuccess={async () => {
await onInstallSuccess?.()
}}
t={t}
t={t as any}
/>
))}
</div>
@ -213,7 +214,7 @@ const FeaturedTriggers = ({
type FeaturedTriggerUninstalledItemProps = {
plugin: Plugin
language: string
language: Locale
onInstallSuccess?: () => Promise<void> | void
t: (key: string, options?: Record<string, any>) => string
}

View File

@ -17,7 +17,7 @@ export const useBlocks = () => {
return BLOCKS.map((block) => {
return {
...block,
title: t(`workflow.blocks.${block.type}`),
title: t(`workflow.blocks.${block.type}` as any) as string,
}
})
}
@ -28,7 +28,7 @@ export const useStartBlocks = () => {
return START_BLOCKS.map((block) => {
return {
...block,
title: t(`workflow.blocks.${block.type}`),
title: t(`workflow.blocks.${block.type}` as any) as string,
}
})
}

View File

@ -43,7 +43,7 @@ const StartBlocks = ({
if (blockType === BlockEnumValues.TriggerWebhook)
return t('workflow.customWebhook')
return t(`workflow.blocks.${blockType}`)
return t(`workflow.blocks.${blockType}` as any) as string
}
return START_BLOCKS.filter((block) => {
@ -83,10 +83,10 @@ const StartBlocks = ({
<div className="system-md-medium mb-1 text-text-primary">
{block.type === BlockEnumValues.TriggerWebhook
? t('workflow.customWebhook')
: t(`workflow.blocks.${block.type}`)}
: t(`workflow.blocks.${block.type}` as any) as string}
</div>
<div className="system-xs-regular text-text-secondary">
{t(`workflow.blocksAbout.${block.type}`)}
{t(`workflow.blocksAbout.${block.type}` as any) as string}
</div>
{(block.type === BlockEnumValues.TriggerWebhook || block.type === BlockEnumValues.TriggerSchedule) && (
<div className="system-xs-regular mb-1 mt-1 text-text-tertiary">
@ -107,7 +107,7 @@ const StartBlocks = ({
type={block.type}
/>
<div className="flex w-0 grow items-center justify-between text-sm text-text-secondary">
<span className="truncate">{t(`workflow.blocks.${block.type}`)}</span>
<span className="truncate">{t(`workflow.blocks.${block.type}` as any) as string}</span>
{block.type === BlockEnumValues.Start && (
<span className="system-xs-regular ml-2 shrink-0 text-text-quaternary">{t('workflow.blocks.originalStartNode')}</span>
)}