Fixed bug where proof of payment download links used raw locationID instead of shareID (locationID + checksum), causing link validation to fail. Added AsyncLink component to handle async shareID generation gracefully. Changes: - BillEditForm: Generate shareID using generateShareId server action - BillEditForm: Use AsyncLink to prevent broken links during async load - AsyncLink: New reusable component for links that need async data - Updated download URL from locationID-billID to shareID-billID format Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
14 lines
503 B
TypeScript
14 lines
503 B
TypeScript
import React from "react";
|
|
import Link from "next/link";
|
|
|
|
/** Link component that can be disabled */
|
|
export const AsyncLink: React.FC<{ href: string; children: React.ReactNode, target?: string, className?: string, disabled?: boolean }> = ({ href, children, target, className, disabled }) =>
|
|
disabled ? <span className={className}>{children}</span> :
|
|
<Link
|
|
href={href}
|
|
target={target}
|
|
className={className}
|
|
>
|
|
{children}
|
|
</Link>
|