diff --git a/packages/web/src/components/ConfirmDialog.tsx b/packages/web/src/components/ConfirmDialog.tsx index 7bd807c..2eb72de 100644 --- a/packages/web/src/components/ConfirmDialog.tsx +++ b/packages/web/src/components/ConfirmDialog.tsx @@ -11,7 +11,7 @@ type ConfirmDialogProps = { variant?: 'danger' | 'warning'; }; -export default function ConfirmDialog({ open, onConfirm, onCancel, title, description, confirmText = 'Confirm', variant = 'danger' }: ConfirmDialogProps) { +export default function ConfirmDialog({ open, onConfirm, onCancel, title, description, confirmText, variant = 'danger' }: ConfirmDialogProps) { const { t } = useI18n(); const iconColor = variant === 'danger' ? 'text-danger bg-danger-muted' : 'text-warning bg-warning-muted'; @@ -35,7 +35,7 @@ export default function ConfirmDialog({ open, onConfirm, onCancel, title, descri onClick={onConfirm} className={variant === 'danger' ? 'btn-danger' : 'btn-primary'} > - {confirmText} + {confirmText ?? t('common.confirm')} diff --git a/packages/web/src/components/SchemaView.tsx b/packages/web/src/components/SchemaView.tsx index 8315237..320ff90 100644 --- a/packages/web/src/components/SchemaView.tsx +++ b/packages/web/src/components/SchemaView.tsx @@ -3,7 +3,7 @@ * Replaces raw JSON.stringify output with readable tables and schema trees. */ -import { useI18n } from '../lib/i18n'; +import { useI18n, type TFunction } from '../lib/i18n'; /* ===== Helpers ===== */ @@ -159,8 +159,7 @@ export function ParametersView({ parameters }: { parameters: unknown }) { /* ===== Schema Properties Tree ===== */ -function SchemaProperties({ schema, depth = 0 }: { schema: SchemaObj; depth?: number }) { - const { t } = useI18n(); +function SchemaProperties({ schema, depth = 0, t }: { schema: SchemaObj; depth?: number; t: TFunction }) { const properties = schema.properties; const requiredSet = new Set(schema.required || []); @@ -217,8 +216,8 @@ function SchemaProperties({ schema, depth = 0 }: { schema: SchemaObj; depth?: nu {t('dashboard.schema.default')} {JSON.stringify(prop.default)} )} - {hasChildren && } - {isArray && prop.items && } + {hasChildren && } + {isArray && prop.items && } ); })} @@ -247,7 +246,7 @@ export function RequestBodyView({ requestBody }: { requestBody: unknown }) { {body.required && {t('dashboard.schema.required')}}

- +
); @@ -274,7 +273,7 @@ export function RequestBodyView({ requestBody }: { requestBody: unknown }) {
{media.schema ? ( media.schema.properties ? ( - + ) : (
@@ -351,13 +350,13 @@ export function ResponsesView({ responses }: { responses: unknown }) { {schema && (schema.properties || schema.items?.properties || schema.type) && (
{schema.properties ? ( - + ) : schema.type === 'array' && schema.items?.properties ? (
{t('dashboard.schema.ofObjects')}
- +
) : (
diff --git a/packages/web/src/components/ThemeToggle.tsx b/packages/web/src/components/ThemeToggle.tsx index c1468cf..74ee49a 100644 --- a/packages/web/src/components/ThemeToggle.tsx +++ b/packages/web/src/components/ThemeToggle.tsx @@ -1,5 +1,5 @@ import { useTheme } from '../lib/theme'; -import { useI18n } from '../lib/i18n'; +import { useI18n, type TranslationKey } from '../lib/i18n'; const icons = { light: ( @@ -31,7 +31,7 @@ export default function ThemeToggle() { ) : ( - {t(`pricing.${key}.cta`)} + {t(tk(`pricing.${key}.cta`))} )}