Skip to content

Commit

Permalink
Added labels for waves in selection
Browse files Browse the repository at this point in the history
  • Loading branch information
dkildar committed Jan 6, 2025
1 parent cc5932f commit 1c0941f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/app/waves/_components/waves-host-selection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Dropdown, DropdownItemWithIcon, DropdownMenu, DropdownToggle } from "@u
import { Button } from "@ui/button";
import { UilApps } from "@tooni/iconscout-unicons-react";
import { UserAvatar } from "@/features/shared";
import { WaveHosts } from "@/features/waves/enums";

interface Props {
host: string;
Expand All @@ -13,14 +14,24 @@ interface Props {

export function WavesHostSelection({ host, setHost }: Props) {
const availableHosts = useMemo(() => ["All", ...AVAILABLE_THREAD_HOSTS], []);
const labels = useMemo(
() =>
({
[WaveHosts.Waves]: "Waves",
[WaveHosts.Leo]: "Threads",
[WaveHosts.Dbuzz]: "Buzz",
[WaveHosts.Liketu]: "Moments"
}) as Record<string, string>,
[]
);

return (
<WavesNavigationLayout>
<div />
<Dropdown>
<DropdownToggle>
<Button icon={<UilApps />} appearance="gray-link">
{host}
{labels[host] ?? host}
</Button>
</DropdownToggle>
<DropdownMenu align="right">
Expand All @@ -31,7 +42,7 @@ export function WavesHostSelection({ host, setHost }: Props) {
onClick={() => setHost(item)}
title={item}
key={item}
label={item}
label={labels[item] ?? item}
/>
))}
</DropdownMenu>
Expand Down

0 comments on commit 1c0941f

Please sign in to comment.