Client-side React component that renders LinkedIn post embeds as iframes, with URL/URN normalization and graceful fallback handling when a post URL cannot be resolved to an embeddable URN. ## Key Components ### `toLinkedInEmbedUrl(url: string): string` Internal utility that normalizes any LinkedIn post URL or URN into LinkedIn's official embed endpoint (`/embed/feed/update/`). Handles four input patterns: - Already-canonical embed URLs - Explicit URNs (`urn:li:activity|share|ugcPost:`) - Activity IDs embedded in URL slugs (`activity-`) - Numeric IDs (15–25 digits) at the end of post URLs Returns `''` when no URN can be derived, signaling the component to render a fallback card. ### `LinkedInEmbedClient` The primary exported component. Accepts a `url` string and optional `height` (default `600px`). Renders one of two states: | State | Condition | Output | |---|---|---| | Fallback card | `embedUrl` is empty | Static card with a "View on LinkedIn" link | | Embed view | Valid embed URL | Skeleton loader → iframe + external link footer | ## Usage Example ```typescript import { LinkedInEmbedClient } from './linkedin-embed-client'; // From a standard post URL // From an explicit URN // Falls back to a link card if the URL cannot be resolved ``` ## Notes - Uses `useMemo` to avoid re-computing the embed URL on every render. - The skeleton loader (animated pulse) is shown until the iframe fires `onLoad`. - LinkedIn iframes do not support auto-resizing; height must be set explicitly via the `height` prop. - All external links use `rel="noopener noreferrer"` for security.