import { RefObject } from 'react'; import { IMedia } from '../types'; /** * Computes the width a media card should occupy so that the image/video is * displayed at its natural aspect ratio while filling the full container height, * capped at `maxWidthRatio` (default 0.8 = 80 %) of the container's width. * * If the natural width would exceed the cap the card stops growing and the * media is cropped by `overflow: hidden` + `objectFit: cover`. * * @param post - The currently displayed media. * @param maxWidthRatio - Maximum fraction of the container width (0–1). Defaults to 0.8. * @returns An object containing: * - `containerRef` – attach this to the container whose dimensions are used as the constraint. * - `cardWidth` – inline `width` value to apply to the media card (e.g. `"480px"` or `"auto"`). */ declare const useMediaCardWidth: (post: IMedia, maxWidthRatio?: number) => { containerRef: RefObject; cardWidth: string; }; export default useMediaCardWidth;