+ {availability ? (
+
+ ) : (
+ <>
+

+
+
+ Couldn't load this video
+
+
+ {countryCode && (
+
+ )}
+
{displayedMessage}
+
+
+ >
+ )}
- {onRetry && (
+ {onRetry && !availability && (
+ );
+}
diff --git a/apps/web/src/components/video-availability-poster.tsx b/apps/web/src/components/video-availability-poster.tsx
new file mode 100644
index 0000000..2a2e5cb
--- /dev/null
+++ b/apps/web/src/components/video-availability-poster.tsx
@@ -0,0 +1,34 @@
+import type { VideoAvailability } from "../lib/video-availability";
+import { videoAvailabilityCopy } from "../lib/video-availability";
+import { VideoAvailabilityIcon } from "./video-availability-icon";
+
+type Props = {
+ availability: VideoAvailability;
+ message: string;
+ poster?: string;
+ compact?: boolean;
+};
+
+export function VideoAvailabilityPoster({ availability, message, poster, compact = false }: Props) {
+ const copy = videoAvailabilityCopy(availability, message);
+ const frameClass = compact ? "h-full w-full" : "aspect-video w-[min(92vw,960px)] rounded-lg";
+
+ return (
+
+ {poster && (
+

+ )}
+
+
+
+
+
{copy.heading}
+
{copy.message}
+
+
+
+ );
+}
diff --git a/apps/web/src/components/video-block-actions-dropdown.tsx b/apps/web/src/components/video-block-actions-dropdown.tsx
index 7b630f9..440a1e6 100644
--- a/apps/web/src/components/video-block-actions-dropdown.tsx
+++ b/apps/web/src/components/video-block-actions-dropdown.tsx
@@ -1,5 +1,6 @@
import { useEffect, useLayoutEffect, useRef, useState } from "react";
import { createPortal } from "react-dom";
+import { watchLaterActionLabel } from "../lib/watch-later-labels";
const MARGIN = 8;
@@ -7,8 +8,11 @@ type Props = {
anchorEl: HTMLElement | null;
onClose: () => void;
onSaveToPlaylist?: () => void;
+ onToggleWatchLater?: () => void;
onToggleVideoBlock?: () => void;
onToggleChannelBlock?: () => void;
+ watchLaterSaved?: boolean;
+ watchLaterPending?: boolean;
videoBlocked?: boolean;
channelBlocked?: boolean;
};
@@ -17,8 +21,11 @@ export function VideoBlockActionsDropdown({
anchorEl,
onClose,
onSaveToPlaylist,
+ onToggleWatchLater,
onToggleVideoBlock,
onToggleChannelBlock,
+ watchLaterSaved = false,
+ watchLaterPending = false,
videoBlocked,
channelBlocked,
}: Props) {
@@ -68,6 +75,20 @@ export function VideoBlockActionsDropdown({
style={panelStyle}
className="fixed z-50 w-56 overflow-hidden rounded-lg border border-border-strong bg-surface shadow-2xl"
>
+ {onToggleWatchLater && (
+
+ )}
{onSaveToPlaylist && (