diff --git a/src/components/nodes/McChannelNameWithType.tsx b/src/components/nodes/McChannelNameWithType.tsx new file mode 100644 index 0000000..26a5d2b --- /dev/null +++ b/src/components/nodes/McChannelNameWithType.tsx @@ -0,0 +1,13 @@ +import type { McChannelRowDisplay } from '@/lib/mc-channel-editor'; + +type McChannelNameWithTypeProps = McChannelRowDisplay; + +/** Channel name with muted PUBLIC / HASHTAG suffix (MeshCore channel editor lists). */ +export function McChannelNameWithType({ label, typeLabel }: McChannelNameWithTypeProps) { + return ( + + {label} + {typeLabel ? {typeLabel} : null} + + ); +} diff --git a/src/components/nodes/MeshCoreChannelEditor.tsx b/src/components/nodes/MeshCoreChannelEditor.tsx index 3aaa77d..23a005c 100644 --- a/src/components/nodes/MeshCoreChannelEditor.tsx +++ b/src/components/nodes/MeshCoreChannelEditor.tsx @@ -14,16 +14,18 @@ import { import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; import { useConstellationChannels } from '@/hooks/api/useConstellations'; import { useMeshtasticApi } from '@/hooks/api/useApi'; -import { filterChannelsForProtocol, formatMessageChannelLabel } from '@/lib/message-channels'; +import { filterChannelsForProtocol } from '@/lib/message-channels'; import { assignedFromFeeder, + assignedMcChannelRowDisplay, assignedOrderKey, assignedToApplyEntries, - formatAssignedMcChannelLabel, + messageChannelRowDisplay, newDraftChannel, reorderAssigned, type AssignedMcChannel, } from '@/lib/mc-channel-editor'; +import { McChannelNameWithType } from '@/components/nodes/McChannelNameWithType'; import type { OwnedManagedNode } from '@/lib/models'; import { cn } from '@/lib/utils'; @@ -183,7 +185,7 @@ export function MeshCoreChannelEditor({ node, open, onOpenChange }: MeshCoreChan className="flex w-full items-center justify-between gap-2 rounded-md border border-transparent px-3 py-2.5 text-left text-sm hover:bg-muted/80 active:bg-muted" onClick={() => assignFromCatalog(ch.id)} > - {formatMessageChannelLabel(ch)} + @@ -267,11 +269,9 @@ export function MeshCoreChannelEditor({ node, open, onOpenChange }: MeshCoreChan className="flex items-center gap-1 rounded-md border border-border bg-card pl-2 pr-1 py-1" > {index} - - {formatAssignedMcChannelLabel(row, catalog, feederSnapshots)} - {row.draft ? ( - (new) - ) : null} + + + {row.draft ? (new) : null}