import { Tabs, TabsContent, TabsList, TabsTrigger, } from "@app/components/UI/Tabs.tsx"; import { Channel } from "@components/PageComponents/Channel.tsx"; import { PageLayout } from "@components/PageLayout.tsx"; import { Sidebar } from "@components/Sidebar.tsx"; import { useDevice } from "@core/stores/deviceStore.ts"; import { Types } from "@meshtastic/core"; import type { Protobuf } from "@meshtastic/core"; import { ImportIcon, QrCodeIcon } from "lucide-react"; import { useState } from "react"; export const getChannelName = (channel: Protobuf.Channel.Channel) => channel.settings?.name.length ? channel.settings?.name : channel.index === 0 ? "Primary" : `Ch ${channel.index}`; const ChannelsPage = () => { const { channels, setDialogOpen } = useDevice(); const [activeChannel, setActiveChannel] = useState( Types.ChannelNumber.Primary, ); const currentChannel = channels.get(activeChannel); const allChannels = Array.from(channels.values()); return ( <> {allChannels.map((channel) => ( {getChannelName(channel)} ))} {allChannels.map((channel) => ( ))} ); }; export default ChannelsPage;