import type { ReactNode } from "react"; import { Pressable, type PressableProps } from "react-native"; import { useActionBarCopy, type UseActionBarCopyOptions, } from "@assistant-ui/core/react"; export type ActionBarCopyProps = Omit & UseActionBarCopyOptions & { children: ReactNode | ((props: { isCopied: boolean }) => ReactNode); }; export const ActionBarCopy = ({ children, disabled: disabledProp, copiedDuration, copyToClipboard, ...pressableProps }: ActionBarCopyProps) => { const { copy, disabled, isCopied } = useActionBarCopy({ copiedDuration, copyToClipboard, }); return ( {typeof children === "function" ? children({ isCopied }) : children} ); };