@payfit/unity-components
Version:
28 lines (27 loc) • 1.74 kB
TypeScript
import { RegisteredRouter, ValidateLinkOptions } from '@tanstack/react-router';
import { RawAIOutcomeCardProps } from '../../../ai-kit/components/ai-outcome-card/RawAIOutcomeCard.js';
type AIOutcomeCardRouterProps<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown> = Omit<RawAIOutcomeCardProps, 'asElement' | 'href'> & ValidateLinkOptions<TRouter, TOptions>;
type AIOutcomeCardButtonProps = Omit<RawAIOutcomeCardProps, 'asElement' | 'href'> & {
onPress: NonNullable<RawAIOutcomeCardProps['onPress']>;
};
/** Props for the TanStack Router-aware {@link AIOutcomeCard}. */
export type AIOutcomeCardProps<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown> = AIOutcomeCardRouterProps<TRouter, TOptions> | AIOutcomeCardButtonProps;
/**
* Connects an AI Outcome Card to typed TanStack Router navigation.
*
* Preserves the raw card's visual, accessibility, and button contracts while
* adding a route-aware link form.
*
* Pass `to` and TanStack Router link options to navigate within the registered
* router. Omit `to`, set `asElement="button"`, and pass `onPress` when the
* card performs an in-place action instead.
* @param props - Typed router link options or raw button props.
* @param props.to - The typed TanStack Router destination for the link form.
* @param props.onPress - Button activation handler when the card is an action.
* @see {@link AIOutcomeCardProps} for all available props.
*/
declare function AIOutcomeCard<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown>(props: AIOutcomeCardProps<TRouter, TOptions>): import('react/jsx-runtime').JSX.Element;
declare namespace AIOutcomeCard {
var displayName: string;
}
export { AIOutcomeCard };