MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / CardStackEntry

Function CardStackEntry

packages/react/src/components/card-stack.tsx:231–254  ·  view source on GitHub ↗
({ className, asChild = false, searchText, ...props }: CardStackEntryProps)

Source from the content-addressed store, hash-verified

229};
230
231function CardStackEntry({ className, asChild = false, searchText, ...props }: CardStackEntryProps) {
232 const { searchable, searchQuery } = React.useContext(CardStackContext);
233
234 if (searchable && searchText !== undefined) {
235 const trimmed = searchQuery.trim().toLowerCase();
236 if (trimmed.length > 0 && !searchText.toLowerCase().includes(trimmed)) {
237 return null;
238 }
239 }
240
241 const Comp = asChild ? Slot.Root : "div";
242 return (
243 <Comp
244 data-slot="card-stack-entry"
245 className={cn(
246 "group/card-stack-entry flex w-full items-center gap-3 px-4 py-3 text-sm outline-none transition-[background-color] duration-150 ease-[cubic-bezier(0.23,1,0.32,1)]",
247 "focus-visible:bg-accent/40",
248 "[&[href]]:cursor-pointer [&[href]]:hover:bg-accent/40",
249 className,
250 )}
251 {...props}
252 />
253 );
254}
255
256type CardStackEntryFieldProps = React.ComponentProps<"div"> & {
257 label?: React.ReactNode;

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected