Skip to content

🎥 Make videos programmatically with React

awesome

Jonny Burgerd6c3fa604ee2
diff --git a/packages/convert/app/components/VideoPreview.tsx b/packages/convert/app/components/VideoPreview.tsx
index 88dea0e3ba..7ac8377e3c 100644
--- a/packages/convert/app/components/VideoPreview.tsx
+++ b/packages/convert/app/components/VideoPreview.tsx
@@ -10,12 +10,13 @@ import {
import React from 'react';
export const VideoPreview: React.FC<{
- children: React.ReactNode;
+ readonly children: React.ReactNode;
}> = ({children}) => {
+ const title = 'bigbuckbfdsdsfkjsdflkunny.mp4';
return (
<Card className="w-[350px]">
<CardHeader>
- <CardTitle>bigbuckbunny.mp4</CardTitle>
+ <CardTitle title={title}>{title}</CardTitle>
<CardDescription>From URL</CardDescription>
</CardHeader>
<CardContent>{children}</CardContent>
diff --git a/packages/convert/app/components/ui/card.tsx b/packages/convert/app/components/ui/card.tsx
index 901efadf5c..3f29afb427 100644
--- a/packages/convert/app/components/ui/card.tsx
+++ b/packages/convert/app/components/ui/card.tsx
@@ -1,79 +1,79 @@
-import * as React from "react"
+import * as React from 'react';
-import { cn } from "~/lib/utils"
+import {cn} from '~/lib/utils';
const Card = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes<HTMLDivElement>
->(({ className, ...props }, ref) => (
- <div
- ref={ref}
- className={cn(
- "rounded-lg border bg-card text-card-foreground shadow-sm",
- className
- )}
- {...props}
- />
-))
-Card.displayName = "Card"
+ HTMLDivElement,
+ React.HTMLAttributes<HTMLDivElement>
+>(({className, ...props}, ref) => (
+ <div
+ ref={ref}
+ className={cn(
+ 'rounded-lg border bg-card text-card-foreground shadow-sm',
+ className,
+ )}
+ {...props}
+ />
+));
+Card.displayName = 'Card';
const CardHeader = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes<HTMLDivElement>
->(({ className, ...props }, ref) => (
- <div
- ref={ref}
- className={cn("flex flex-col space-y-1.5 p-6", className)}
- {...props}
- />
-))
-CardHeader.displayName = "CardHeader"
+ HTMLDivElement,
+ React.HTMLAttributes<HTMLDivElement>
+>(({className, ...props}, ref) => (
+ <div
+ ref={ref}
+ className={cn('flex flex-col space-y-1.5 p-6', className)}
+ {...props}
+ />
+));
+CardHeader.displayName = 'CardHeader';
const CardTitle = React.forwardRef<
- HTMLParagraphElement,
- React.HTMLAttributes<HTMLHeadingElement>
->(({ className, ...props }, ref) => (
- <h3
- ref={ref}
- className={cn(
- "text-2xl font-semibold leading-none tracking-tight",
- className
- )}
- {...props}
- />
-))
-CardTitle.displayName = "CardTitle"
+ HTMLParagraphElement,
+ React.HTMLAttributes<HTMLHeadingElement>
+>(({className, ...props}, ref) => (
+ <h3
+ ref={ref}
+ className={cn(
+ 'text-2xl font-semibold tracking-tight text-ellipsis overflow-x-hidden',
+ className,
+ )}
+ {...props}
+ />
+));
+CardTitle.displayName = 'CardTitle';
const CardDescription = React.forwardRef<
- HTMLParagraphElement,
- React.HTMLAttributes<HTMLParagraphElement>
->(({ className, ...props }, ref) => (
- <p
- ref={ref}
- className={cn("text-sm text-muted-foreground", className)}
- {...props}
- />
-))
-CardDescription.displayName = "CardDescription"
+ HTMLParagraphElement,
+ React.HTMLAttributes<HTMLParagraphElement>
+>(({className, ...props}, ref) => (
+ <p
+ ref={ref}
+ className={cn('text-sm text-muted-foreground', className)}
+ {...props}
+ />
+));
+CardDescription.displayName = 'CardDescription';
const CardContent = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes<HTMLDivElement>
->(({ className, ...props }, ref) => (
- <div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
-))
-CardContent.displayName = "CardContent"
+ HTMLDivElement,
+ React.HTMLAttributes<HTMLDivElement>
+>(({className, ...props}, ref) => (
+ <div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
+));
+CardContent.displayName = 'CardContent';
const CardFooter = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes<HTMLDivElement>
->(({ className, ...props }, ref) => (
- <div
- ref={ref}
- className={cn("flex items-center p-6 pt-0", className)}
- {...props}
- />
-))
-CardFooter.displayName = "CardFooter"
+ HTMLDivElement,
+ React.HTMLAttributes<HTMLDivElement>
+>(({className, ...props}, ref) => (
+ <div
+ ref={ref}
+ className={cn('flex items-center p-6 pt-0', className)}
+ {...props}
+ />
+));
+CardFooter.displayName = 'CardFooter';
-export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
+export {Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle};