MCPcopy Create free account
hub / github.com/dailydotdev/apps / MonthSelect

Function MonthSelect

packages/shared/src/components/profile/MonthSelect.tsx:37–74  ·  view source on GitHub ↗
({
  icon,
  placeholder,
  value,
  onSelect,
  disabled,
}: MonthSelectProps)

Source from the content-addressed store, hash-verified

35};
36
37const MonthSelect = ({
38 icon,
39 placeholder,
40 value,
41 onSelect,
42 disabled,
43}: MonthSelectProps) => {
44 const menuItems: MenuItemProps[] = MONTHS.map((opt) => ({
45 label: opt.label,
46 action: () => onSelect?.(opt.value),
47 }));
48
49 const selectedLabel = MONTHS.find((opt) => opt.value === value)?.label;
50
51 return (
52 <DropdownMenu>
53 <DropdownMenuTrigger className="w-full" asChild disabled={disabled}>
54 <Button
55 icon={icon}
56 variant={ButtonVariant.Float}
57 size={ButtonSize.Large}
58 disabled={disabled}
59 >
60 {selectedLabel || placeholder}
61 <ArrowIcon className="ml-auto rotate-180" secondary />
62 </Button>
63 </DropdownMenuTrigger>
64 <DropdownMenuContent
65 variant="field"
66 align="start"
67 sideOffset={10}
68 className="flex flex-col gap-1 !p-0"
69 >
70 <DropdownMenuOptions options={menuItems} />
71 </DropdownMenuContent>
72 </DropdownMenu>
73 );
74};
75
76export default MonthSelect;

Callers

nothing calls this directly

Calls 1

onSelectFunction · 0.50

Tested by

no test coverage detected