import * as React from "react"; /** * Base UI replaced Radix's `asChild` with a `render` prop that takes the * element itself rather than a boolean plus a child. Trigger components accept * `asChild` for shadcn compatibility and translate it here. */ export function asChildProps( asChild: boolean | undefined, children: React.ReactNode, ): { render: React.ReactElement } | { children: React.ReactNode } { return asChild && React.isValidElement(children) ? { render: children } : { children }; }