Free & Open-Source Invoice Generator - No Sign-Up, No Ads, Instant PDF Export, 100% In-Browser, and Fully Customizable Templates.
TypeScript fintechinvoiceinvoice-generatorinvoice-pdfinvoice-templateinvoicesnextjsopen-sourcequotesreactreact-pdf-rendererself-hostedshadcn-uitailwindcsstypescript
"use client";
import { HowItWorksVideos } from "@/app/(main)/(app)/components/how-it-works-videos";
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
} from "@/components/ui/dialog";
import { HOW_IT_WORKS_VIDEOS } from "@/config";
interface HowItWorksVideoDialogProps {
open: boolean;
onOpenChange: (open: boolean) => void;
}
const DEFAULT_VIDEO_ID = HOW_IT_WORKS_VIDEOS[0].id;
/**
* Dialog component for displaying "How it works" demo videos by use case.
*/
export function HowItWorksVideoDialog({
open,
onOpenChange,
}: HowItWorksVideoDialogProps) {
const activeVideo = HOW_IT_WORKS_VIDEOS[0];
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="flex max-h-[calc(100dvh-0.75rem)] w-[calc(100%-0.75rem)] max-w-[calc(100%-0.75rem)] flex-col gap-0 overflow-y-auto overflow-x-hidden p-0 sm:max-h-[calc(100vh-2rem)] sm:w-full sm:max-w-[800px]">
<DialogHeader className="sr-only">
<DialogTitle>{activeVideo.title}</DialogTitle>
<DialogDescription>{activeVideo.description}</DialogDescription>
</DialogHeader>
<HowItWorksVideos
// Radix keeps the dialog content mounted after it closes, so remount the
// player on every open: it starts from `initialVideoId` with a fresh iframe
key={String(open)}
initialVideoId={DEFAULT_VIDEO_ID}
showIframe={open}
className="gap-0"
/>
</DialogContent>
</Dialog>
);
}