'use client'; import { useState } from 'react'; import { motion } from 'framer-motion'; import { CloseIcon, PlusIcon } from './Icons'; export default function GroupModal({ onClose, onConfirm }) { const [name, setName] = useState(''); return ( e.stopPropagation()} >
新增分组
{ const v = e.target.value || ''; // 限制最多 8 个字符(兼容中英文),超出部分自动截断 setName(v.slice(0, 8)); }} onKeyDown={(e) => { if (e.key === 'Enter' && name.trim()) onConfirm(name.trim()); }} />
); }