Files
outline/shared/editor/embeds/Berrycast.tsx
codegen-sh[bot] c6fc6230ff Replace useComponentSize with react-use-measure (#9838)
* Replace useComponentSize with react-use-measure

- Add react-use-measure dependency
- Replace all useComponentSize usages with useMeasure hook
- Remove useComponentSize hook file
- Update imports across all affected components:
  - app/components/Header.tsx
  - app/components/ResizingHeightContainer.tsx
  - app/scenes/Document/components/Header.tsx
  - app/scenes/Document/components/MeasuredContainer.tsx
  - shared/editor/embeds/Berrycast.tsx

Fixes #9812

* Remove unused breadcrumbsRef

The breadcrumbsRef is no longer needed since we're using breadcrumbsMeasureRef directly for measuring the breadcrumbs element.

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
2025-08-05 10:40:10 -04:00

23 lines
580 B
TypeScript

import * as React from "react";
import useMeasure from "react-use-measure";
import Frame from "../components/Frame";
import { EmbedProps as Props } from ".";
export default function Berrycast({ matches, ...props }: Props) {
const normalizedUrl = props.attrs.href.replace(/\/$/, "");
const [measureRef, { width }] = useMeasure();
return (
<>
<div ref={measureRef} />
<Frame
{...props}
src={`${normalizedUrl}/video-player`}
title="Berrycast Embed"
height={`${0.5625 * width}px`}
border={false}
/>
</>
);
}