MCPcopy Create free account
hub / github.com/fontsource/fontsource / DropdownCheckbox

Function DropdownCheckbox

website/app/components/Dropdown.tsx:148–197  ·  view source on GitHub ↗
({
	label,
	items,
	w,
	noBorder,
	refine,
	showCount,
	search,
}: DropdownProps)

Source from the content-addressed store, hash-verified

146};
147
148const DropdownCheckbox = ({
149 label,
150 items,
151 w,
152 noBorder,
153 refine,
154 showCount,
155 search,
156}: DropdownProps) => {
157 const options = items.map((item) => (
158 <Combobox.Option
159 value={item.value}
160 key={item.value}
161 active={item.isRefined}
162 >
163 <Group gap="sm" justify="flex-start">
164 <Checkbox
165 checked={item.isRefined}
166 aria-hidden
167 tabIndex={-1}
168 style={{ pointerEvents: 'none' }}
169 readOnly
170 />
171 <span className={classes.option}>{item.label ?? item.value}</span>
172 {showCount && item.count && (
173 <Badge
174 variant="light"
175 color="gray"
176 size="sm"
177 className={classes.count}
178 >
179 {item.count}
180 </Badge>
181 )}
182 </Group>
183 </Combobox.Option>
184 ));
185
186 return (
187 <DropdownBase
188 label={label}
189 options={options}
190 w={w}
191 noBorder={noBorder}
192 refine={refine}
193 search={search}
194 disabled={items.length === 0 && !search}
195 />
196 );
197};
198
199export { DropdownCheckbox, DropdownSimple };

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected