From c9bb740a6b4a4b9f306c533c05b0076f2423b203 Mon Sep 17 00:00:00 2001 From: Rohit Gahlawat Date: Wed, 10 Jun 2026 07:42:40 +0530 Subject: [PATCH] refactor(web): mark Props of billing/ components as read-only (#25219) (#37249) --- web/app/components/billing/annotation-full/modal.tsx | 4 ++-- web/app/components/billing/annotation-full/usage.tsx | 4 ++-- web/app/components/billing/header-billing-btn/index.tsx | 4 ++-- web/app/components/billing/plan-upgrade-modal/index.tsx | 4 ++-- web/app/components/billing/plan/index.tsx | 4 ++-- .../components/billing/trigger-events-limit-modal/index.tsx | 4 ++-- web/app/components/billing/upgrade-btn/index.tsx | 4 ++-- web/app/components/billing/usage-info/apps-info.tsx | 4 ++-- web/app/components/billing/usage-info/index.tsx | 4 ++-- web/app/components/billing/usage-info/vector-space-info.tsx | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/web/app/components/billing/annotation-full/modal.tsx b/web/app/components/billing/annotation-full/modal.tsx index 00f38734d1..b5b247e0b6 100644 --- a/web/app/components/billing/annotation-full/modal.tsx +++ b/web/app/components/billing/annotation-full/modal.tsx @@ -9,10 +9,10 @@ import UpgradeBtn from '../upgrade-btn' import s from './style.module.css' import Usage from './usage' -type Props = { +type Props = Readonly<{ show: boolean onHide: () => void -} +}> const AnnotationFullModal: FC = ({ show, onHide, diff --git a/web/app/components/billing/annotation-full/usage.tsx b/web/app/components/billing/annotation-full/usage.tsx index cb44e7539e..84203be1db 100644 --- a/web/app/components/billing/annotation-full/usage.tsx +++ b/web/app/components/billing/annotation-full/usage.tsx @@ -6,9 +6,9 @@ import { useProviderContext } from '@/context/provider-context' import { MessageFastPlus } from '../../base/icons/src/vender/line/communication' import UsageInfo from '../usage-info' -type Props = { +type Props = Readonly<{ className?: string -} +}> const Usage: FC = ({ className, diff --git a/web/app/components/billing/header-billing-btn/index.tsx b/web/app/components/billing/header-billing-btn/index.tsx index a71c123622..8c1168ae44 100644 --- a/web/app/components/billing/header-billing-btn/index.tsx +++ b/web/app/components/billing/header-billing-btn/index.tsx @@ -6,10 +6,10 @@ import { useProviderContext } from '@/context/provider-context' import { Plan } from '../type' import UpgradeBtn from '../upgrade-btn' -type Props = { +type Props = Readonly<{ onClick?: () => void isDisplayOnly?: boolean -} +}> const HeaderBillingBtn: FC = ({ onClick, diff --git a/web/app/components/billing/plan-upgrade-modal/index.tsx b/web/app/components/billing/plan-upgrade-modal/index.tsx index 0d40edcfad..6503952bd0 100644 --- a/web/app/components/billing/plan-upgrade-modal/index.tsx +++ b/web/app/components/billing/plan-upgrade-modal/index.tsx @@ -8,7 +8,7 @@ import UpgradeBtn from '@/app/components/billing/upgrade-btn' import { useModalContext } from '@/context/modal-context' import { SquareChecklist } from '../../base/icons/src/vender/other' -type Props = { +type Props = Readonly<{ Icon?: ComponentType<{ className?: string }> title: string description: string @@ -16,7 +16,7 @@ type Props = { show: boolean onClose: () => void onUpgrade?: () => void -} +}> export function PlanUpgradeModal({ Icon = SquareChecklist, diff --git a/web/app/components/billing/plan/index.tsx b/web/app/components/billing/plan/index.tsx index 25ea5e9882..55d4a714d2 100644 --- a/web/app/components/billing/plan/index.tsx +++ b/web/app/components/billing/plan/index.tsx @@ -31,9 +31,9 @@ import AppsInfo from '../usage-info/apps-info' import VectorSpaceInfo from '../usage-info/vector-space-info' import { Enterprise, Professional, Sandbox, Team } from './assets' -type Props = { +type Props = Readonly<{ loc: string -} +}> const PlanComp: FC = ({ loc, diff --git a/web/app/components/billing/trigger-events-limit-modal/index.tsx b/web/app/components/billing/trigger-events-limit-modal/index.tsx index 9312f772b5..ed5bd9d632 100644 --- a/web/app/components/billing/trigger-events-limit-modal/index.tsx +++ b/web/app/components/billing/trigger-events-limit-modal/index.tsx @@ -4,14 +4,14 @@ import { TriggerAll } from '@/app/components/base/icons/src/vender/workflow' import { PlanUpgradeModal } from '@/app/components/billing/plan-upgrade-modal' import UsageInfo from '@/app/components/billing/usage-info' -type Props = { +type Props = Readonly<{ show: boolean onClose: () => void onUpgrade: () => void usage: number total: number resetInDays?: number -} +}> export default function TriggerEventsLimitModal({ show, diff --git a/web/app/components/billing/upgrade-btn/index.tsx b/web/app/components/billing/upgrade-btn/index.tsx index e5b53555c2..573468fdea 100644 --- a/web/app/components/billing/upgrade-btn/index.tsx +++ b/web/app/components/billing/upgrade-btn/index.tsx @@ -8,7 +8,7 @@ import { SparklesSoft } from '@/app/components/base/icons/src/public/common' import { useModalContext } from '@/context/modal-context' import { PremiumBadgeButton } from '../../base/premium-badge' -type Props = { +type Props = Readonly<{ className?: string style?: CSSProperties isFull?: boolean @@ -18,7 +18,7 @@ type Props = { onClick?: () => void loc?: string labelKey?: Exclude, 'plans.community.features' | 'plans.enterprise.features' | 'plans.premium.features'> -} +}> type GtagHandler = (command: 'event', action: 'click_upgrade_btn', payload: { loc: string }) => void diff --git a/web/app/components/billing/usage-info/apps-info.tsx b/web/app/components/billing/usage-info/apps-info.tsx index 3af14f63d2..9fca5f4e78 100644 --- a/web/app/components/billing/usage-info/apps-info.tsx +++ b/web/app/components/billing/usage-info/apps-info.tsx @@ -8,9 +8,9 @@ import { useTranslation } from 'react-i18next' import { useProviderContext } from '@/context/provider-context' import UsageInfo from '../usage-info' -type Props = { +type Props = Readonly<{ className?: string -} +}> const AppsInfo: FC = ({ className, diff --git a/web/app/components/billing/usage-info/index.tsx b/web/app/components/billing/usage-info/index.tsx index 56166ce631..7826a7e363 100644 --- a/web/app/components/billing/usage-info/index.tsx +++ b/web/app/components/billing/usage-info/index.tsx @@ -9,7 +9,7 @@ import { useTranslation } from 'react-i18next' import { Infotip } from '@/app/components/base/infotip' import { NUM_INFINITE } from '../config' -type Props = { +type Props = Readonly<{ className?: string Icon: ComponentType<{ className?: string }> name: string @@ -26,7 +26,7 @@ type Props = { storageThreshold?: number storageTooltip?: string isSandboxPlan?: boolean -} +}> const UsageInfo: FC = ({ className, diff --git a/web/app/components/billing/usage-info/vector-space-info.tsx b/web/app/components/billing/usage-info/vector-space-info.tsx index c5f23bf422..9772e746c7 100644 --- a/web/app/components/billing/usage-info/vector-space-info.tsx +++ b/web/app/components/billing/usage-info/vector-space-info.tsx @@ -12,9 +12,9 @@ import { Plan } from '../type' import UsageInfo from '../usage-info' import { getPlanVectorSpaceLimitMB } from '../utils' -type Props = { +type Props = Readonly<{ className?: string -} +}> // Storage threshold in MB - usage below this shows as "< 50 MB" const STORAGE_THRESHOLD_MB = getPlanVectorSpaceLimitMB(Plan.sandbox)