@activecollab/components
Version:
ActiveCollab Components
28 lines • 1.39 kB
TypeScript
import React, { ReactElement } from "react";
import { UnfurlController } from "./unfurl";
/**
* LinkCard — a link preview as a LIFECYCLE, not two static layouts.
*
* Data climbs a progressive ladder (url → basic → full); the anatomy is
* CONSTANT at every tier, so each slot swaps a skeleton for real content in
* place and the card never reflows on upgrade. Four statuses layer on top:
* resolving — climbing the ladder, aspect + rows reserved by skeletons
* resolved — the full card
* stale — resolved, but past its cache window: shows `fetchedAt` and a
* re-unfurl affordance
* error — the unfurl failed: favicon + raw URL + retry, NO media
*
* Compact ↔ expanded is a user-switchable DISPLAY LEVEL on the same link
* entity (the data lives in the controller, so switching never refetches or
* loses it) — not two separate card types.
*/
export type LinkDisplay = "compact" | "expanded";
export interface LinkCardProps {
unfurl: UnfurlController;
display?: LinkDisplay;
onToggleDisplay?: () => void;
}
export declare const LinkCard: ({ unfurl, display, onToggleDisplay, }: LinkCardProps) => ReactElement;
export declare const LinkSkeleton: () => ReactElement;
export declare const LinkPlaceholder: (props: React.ButtonHTMLAttributes<HTMLButtonElement>) => ReactElement;
//# sourceMappingURL=LinkCard.d.ts.map