Add banner for no provider subs!

This commit is contained in:
Captain Jack Sparrow 2024-05-24 03:22:15 +00:00
parent ad85a9fddd
commit 72b034bf83
2 changed files with 19 additions and 2 deletions

View File

@ -376,7 +376,9 @@
},
"title": "Subtitles",
"unknownLanguage": "Unknown",
"dropSubtitleFile": "Drop subtitle file here! >_<"
"dropSubtitleFile": "Drop subtitle file here! >_<",
"scrapeButton": "Scrape subtitles",
"empty": "There are no provided subtitles for this."
}
},
"metadata": {

View File

@ -253,7 +253,22 @@ export function CaptionsView({ id }: { id: string }) {
{t("player.menus.subtitles.offChoice")}
</CaptionOption>
<CustomCaptionOption />
{content}
{content.length === 0 ? (
<div className="p-4 rounded-xl bg-video-context-light bg-opacity-10 font-medium text-center">
<div className="flex flex-col items-center justify-center gap-3">
{t("player.menus.subtitles.empty")}
<button
type="button"
onClick={() => router.navigate("/captions/opensubtitles")}
className="p-1 w-3/4 rounded tabbable duration-200 bg-opacity-10 bg-video-context-light hover:bg-opacity-20"
>
{t("player.menus.subtitles.scrapeButton")}
</button>
</div>
</div>
) : (
content
)}
</Menu.ScrollToActiveSection>
</FileDropHandler>
</>