Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

refactor(web): mark Props of share/ components as read-only (#25219) (#37292)

Rohit Gahlawatbe2034f681d6
diff --git a/web/app/components/share/text-generation/info-modal.tsx b/web/app/components/share/text-generation/info-modal.tsx
index 894ca8781ee..0e5007c9ea5 100644
--- a/web/app/components/share/text-generation/info-modal.tsx
+++ b/web/app/components/share/text-generation/info-modal.tsx
@@ -5,11 +5,11 @@ import * as React from 'react'
import AppIcon from '@/app/components/base/app-icon'
import { appDefaultIconBackground } from '@/config'
-type Props = {
+type Props = Readonly<{
data?: SiteInfo
isShow: boolean
onClose: () => void
-}
+}>
const InfoModal = ({
isShow,
diff --git a/web/app/components/share/text-generation/menu-dropdown.tsx b/web/app/components/share/text-generation/menu-dropdown.tsx
index 89983552f7f..e09e0f989b9 100644
--- a/web/app/components/share/text-generation/menu-dropdown.tsx
+++ b/web/app/components/share/text-generation/menu-dropdown.tsx
@@ -21,11 +21,11 @@ import { usePathname, useRouter } from '@/next/navigation'
import { webAppLogout } from '@/service/webapp-auth'
import InfoModal from './info-modal'
-type Props = {
+type Props = Readonly<{
data?: SiteInfo
placement?: Placement
hideLogout?: boolean
-}
+}>
const MenuDropdown: FC<Props> = ({
data,
diff --git a/web/app/components/share/text-generation/run-batch/csv-reader/index.tsx b/web/app/components/share/text-generation/run-batch/csv-reader/index.tsx
index 33af235f5cf..5147eb7a090 100644
--- a/web/app/components/share/text-generation/run-batch/csv-reader/index.tsx
+++ b/web/app/components/share/text-generation/run-batch/csv-reader/index.tsx
@@ -9,9 +9,9 @@ import {
} from 'react-papaparse'
import { Csv as CSVIcon } from '@/app/components/base/icons/src/public/files'
-type Props = {
+type Props = Readonly<{
onParsed: (data: string[][]) => void
-}
+}>
const CSVReader: FC<Props> = ({
onParsed,