refactor(web): mark Props of misc components as read-only (#25219) (#37294)

This commit is contained in:
Rohit Gahlawat 2026-06-10 23:48:02 +05:30 committed by GitHub
parent a83118c0f4
commit 62a1476a95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 12 additions and 12 deletions

View File

@ -21,7 +21,7 @@ import AppInfo from './app-info'
import { getAppModeLabel } from './app-info/app-mode-labels'
import NavLink from './nav-link'
type Props = {
type Props = Readonly<{
navigation: Array<{
name: string
href: string
@ -29,7 +29,7 @@ type Props = {
selectedIcon: NavIcon
}>
appInfoActions?: AppInfoActions
}
}>
const AppSidebarDropdown = ({ navigation, appInfoActions }: Props) => {
const { t } = useTranslation()

View File

@ -37,9 +37,9 @@ const CreateFromDSLModal = dynamic(() => import('@/app/components/app/create-fro
ssr: false,
})
type Props = {
type Props = Readonly<{
controlRefreshList?: number
}
}>
function List({
controlRefreshList = 0,
}: Props) {

View File

@ -6,14 +6,14 @@ import { useTranslation } from 'react-i18next'
import { usePathname } from '@/next/navigation'
import { slashCommandRegistry } from './actions/commands/registry'
type Props = {
type Props = Readonly<{
actions: Record<string, ActionItem>
onCommandSelect: (commandKey: string) => void
searchFilter?: string
commandValue?: string
onCommandValueChange?: (value: string) => void
originalQuery?: string
}
}>
const CommandSelector: FC<Props> = ({ actions, onCommandSelect, searchFilter, commandValue, onCommandValueChange, originalQuery }) => {
const { t } = useTranslation()

View File

@ -18,9 +18,9 @@ import {
useGotoAnythingSearch,
} from './hooks'
type Props = {
type Props = Readonly<{
onHide?: () => void
}
}>
const GotoAnythingDialog: FC<Props> = ({
onHide,

View File

@ -30,12 +30,12 @@ import { useDeleteSnippetMutation, useExportSnippetMutation, useUpdateSnippetMut
import { downloadBlob } from '@/utils/download'
import { formatTime } from '@/utils/time'
type Props = {
type Props = Readonly<{
snippet: SnippetListItem
onOpenTagManagement?: () => void
onRefresh?: () => void
onTagsChange?: () => void
}
}>
const SnippetCard = ({
snippet,

View File

@ -2,12 +2,12 @@ import type { SetTryAppPanel, TryAppSelection } from '@/types/try-app'
import { noop } from 'es-toolkit/function'
import { createContext } from 'use-context-selector'
type Props = {
type Props = Readonly<{
currentApp?: TryAppSelection
isShowTryAppPanel: boolean
setShowTryAppPanel: SetTryAppPanel
controlHideCreateFromTemplatePanel: number
}
}>
const AppListContext = createContext<Props>({
isShowTryAppPanel: false,