Fix crash for PDF route when the page include an Ask AI button (#4121)

This commit is contained in:
spastorelli
2026-03-16 15:41:16 +01:00
committed by GitHub
parent a7c0f7251b
commit f09ca60930
@@ -7,7 +7,7 @@ import { InlineActionButton } from './InlineActionButton';
import { NotFoundRefHoverCard } from './NotFoundRefHoverCard';
export function InlineButton(props: InlineProps<api.DocumentInlineButton>) {
const { inline } = props;
const { inline, context } = props;
const buttonProps: ButtonProps = {
label: inline.data.label,
@@ -17,7 +17,8 @@ export function InlineButton(props: InlineProps<api.DocumentInlineButton>) {
};
const ButtonImplementation = () => {
if ('action' in inline.data && 'query' in inline.data.action) {
// In print/PDF mode, skip interactive action buttons (AI/search providers are not mounted).
if (context.mode !== 'print' && 'action' in inline.data && 'query' in inline.data.action) {
return (
<InlineActionButton
action={inline.data.action.action}