feat(home): 支持蓝牙输入协议显示逻辑

- 新增蓝牙输入协议索引常量,与输入选项保持一致
- 导入并使用 INPUT_BLUETOOTH_INDEX 判断蓝牙输入状态
- 仅当输入为蓝牙且状态有效时显示蓝牙信息区域
- 优化输入状态判断逻辑,提升代码可读性和维护性
This commit is contained in:
eafonyang
2026-09-24 13:40:00 +08:00
parent 16f1d5aee7
commit 9f1ddc156e
2 changed files with 10 additions and 2 deletions
+8 -2
View File
@@ -23,7 +23,13 @@ import {
AlertDialogHeader,
AlertDialogTitle,
} from "@/components/ui/alert-dialog";
import { getHeadphoneMaxVolumeDb, getHomeVolumeMax, INPUT_LABELS, OUTPUT_LABELS } from "@/lib/luxsinApi";
import {
getHeadphoneMaxVolumeDb,
getHomeVolumeMax,
INPUT_BLUETOOTH_INDEX,
INPUT_LABELS,
OUTPUT_LABELS,
} from "@/lib/luxsinApi";
import { cn } from "@/lib/utils";
import {
ChevronRight,
@@ -786,7 +792,7 @@ export default function Home() {
)}
{/* Bluetooth info */}
{ds.bt_status !== 0 && (
{ds.input === INPUT_BLUETOOTH_INDEX && ds.bt_status !== 0 && (
<div className="mt-3 px-3 py-3 text-center">
<div className="flex items-center justify-center gap-1.5 mb-1">
<Bluetooth size={14} className="text-[#00FFF6]" />