import { ArrowRight, ArrowSquareOut as ExternalLink, Question as HelpCircle, Keyboard, ChatDots as MessageSquareMore, Scissors, GearSix as Settings2, XLogo as Twitter, } from "@phosphor-icons/react"; import { useEffect, useState } from "react"; import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; import { useScopedT } from "@/contexts/I18nContext"; import { useShortcuts } from "@/contexts/ShortcutsContext"; import { formatBinding, SHORTCUT_ACTIONS, SHORTCUT_LABELS } from "@/lib/shortcuts"; import { formatShortcut } from "@/utils/platformUtils"; import { toast } from "@/components/ui/toast"; export const RECORDLY_ISSUES_URL = "https://github.com/webadderallorg/Recordly/issues"; const RECORDLY_DISCORD_URL = "https://discord.gg/sdv2FBVNgE"; const RECORDLY_X_URL = "https://x.com/webadderall"; const CONTACT_EMAIL = "youngchen3442@gmail.com"; export const APP_HEADER_ACTION_BUTTON_CLASS = "h-7 px-2 text-xs text-muted-foreground hover:bg-foreground/10 hover:text-foreground transition-all gap-1.5"; export const APP_HEADER_ICON_BUTTON_CLASS = "h-9 w-9 min-w-9 p-0 text-muted-foreground hover:bg-foreground/10 hover:text-foreground transition-all"; interface KeyboardShortcutsDialogProps { triggerLabel?: string; triggerClassName?: string; } function DiscordIcon(props: React.SVGProps) { return ( ); } export async function openExternalLink(url: string, errorMessage: string) { try { const result = await window.electronAPI.openExternalUrl(url); if (!result.success) { toast.error(result.error || errorMessage); } } catch (error) { toast.error(`${errorMessage} ${String(error)}`); } } export function DiscordLinkButton() { const t = useScopedT("editor"); return ( ); } export function FeedbackDialog() { const t = useScopedT("editor"); return ( {" "} {t("feedback.title", "Feedback & contact")} {t( "feedback.description", "Reach out directly or open an issue if something is broken or missing.", )}

{t("feedback.emailLabel", "Email")}

{CONTACT_EMAIL}

{t("feedback.xLabel", "X")}

@webadderall

); } export function KeyboardShortcutsDialog({ triggerLabel, triggerClassName, }: KeyboardShortcutsDialogProps) { const { shortcuts, isMac, openConfig } = useShortcuts(); const t = useScopedT("editor"); const [scrollLabels, setScrollLabels] = useState({ pan: "Shift + Scroll", zoom: "Ctrl + Scroll", }); useEffect(() => { Promise.all([formatShortcut(["shift", "Scroll"]), formatShortcut(["mod", "Scroll"])]).then( ([pan, zoom]) => setScrollLabels({ pan, zoom }), ); }, []); return ( {" "} {t("keyboardShortcuts.title")} {t( "keyboardShortcuts.description", "Quick reference for the timeline and editor controls.", )}
{SHORTCUT_ACTIONS.map((action) => (
{SHORTCUT_LABELS[action]} {formatBinding(shortcuts[action], isMac)}
))}

{t("keyboardShortcuts.panTimeline")}

{scrollLabels.pan}

{t("keyboardShortcuts.zoomTimeline")}

{scrollLabels.zoom}

{t("keyboardShortcuts.cycleAnnotations")}

{t("keyboardShortcuts.tab")}
); } export function TutorialHelp() { const t = useScopedT("editor"); return ( {t("tutorial.title")} {t("tutorial.understanding")}
{/* Explanation */}

{t("tutorial.descriptionP1")} {" "} {t("tutorial.descriptionRemove")} . {t("tutorial.descriptionP3")}

{/* Visual Illustration */}

{t("tutorial.visualExample")}

{/* Background track (Kept parts) */}
{/* Solid line representing video */}
{/* Removed Segment 1 */}
{t("tutorial.removed")}
{/* Removed Segment 2 */}
{t("tutorial.removed")}
{/* Labels for kept parts */}
{t("tutorial.kept")}
{t("tutorial.kept")}
{t("tutorial.kept")}
{/* Result */}
{t("tutorial.part", undefined, { number: "1" })}
{t("tutorial.part", undefined, { number: "2" })}
{t("tutorial.part", undefined, { number: "3" })}
{t("tutorial.finalVideo")}
{/* Steps */}
{t("tutorial.addTrimStep")}

{t("tutorial.addTrimDesc")}

{t("tutorial.adjustStep")}

{t("tutorial.adjustDesc")}

); }