@@ -13,7 +13,6 @@ import { faPen } from "@fortawesome/free-solid-svg-icons";
1313import { addToast } from "@heroui/toast" ;
1414
1515import { buildApiUrl } from "@/lib/utils" ;
16- import { useTextLimit , TEXT_LIMITS } from "@/lib/utils/text-limits" ;
1716
1817interface RenameTunnelModalProps {
1918 isOpen : boolean ;
@@ -33,9 +32,6 @@ export default function RenameTunnelModal({
3332 const [ newTunnelName , setNewTunnelName ] = useState ( "" ) ;
3433 const [ isLoading , setIsLoading ] = useState ( false ) ;
3534
36- // 使用公共的文本限制工具
37- const textLimit = useTextLimit ( newTunnelName , TEXT_LIMITS . TUNNEL_NAME ) ;
38-
3935 // 当模态框打开时,设置当前名称
4036 React . useEffect ( ( ) => {
4137 if ( isOpen ) {
@@ -44,7 +40,7 @@ export default function RenameTunnelModal({
4440 } , [ isOpen , currentName ] ) ;
4541
4642 const handleSubmit = async ( ) => {
47- if ( ! newTunnelName . trim ( ) || textLimit . isOverLimit ) return ;
43+ if ( ! newTunnelName . trim ( ) ) return ;
4844
4945 try {
5046 setIsLoading ( true ) ;
@@ -101,7 +97,6 @@ export default function RenameTunnelModal({
10197 < ModalBody >
10298 < Input
10399 autoFocus
104- description = { textLimit . description }
105100 isDisabled = { isLoading }
106101 label = "实例名称"
107102 placeholder = "请输入新的实例名称"
@@ -124,8 +119,7 @@ export default function RenameTunnelModal({
124119 color = "primary"
125120 isDisabled = {
126121 ! newTunnelName . trim ( ) ||
127- newTunnelName . trim ( ) === currentName ||
128- textLimit . isOverLimit
122+ newTunnelName . trim ( ) === currentName
129123 }
130124 isLoading = { isLoading }
131125 onPress = { handleSubmit }
0 commit comments