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

Function YearSelect

packages/shared/src/components/profile/YearSelect.tsx:36–73  ·  view source on GitHub ↗
({
  icon,
  placeholder,
  value,
  onSelect,
  disabled,
}: YearSelectProps)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

onSelectFunction · 0.50

Tested by

no test coverage detected