import './ModeSwitch.css' function ModeSwitch({ value = 'view', onChange, viewLabel = '浏览', editLabel = '编辑', options, ariaLabel = '模式切换', }) { const finalOptions = options || [ { label: viewLabel, value: 'view' }, { label: editLabel, value: 'edit' }, ] const activeIndex = Math.max( 0, finalOptions.findIndex((item) => item.value === value) ) return (