mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 09:36:08 +00:00
refactor: eslint and prettier conflict will be resolved and formatted
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
"use client";
|
||||
'use client';
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { AlertTriangle, Film } from "lucide-react";
|
||||
import { useEffect } from 'react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { AlertTriangle, Film } from 'lucide-react';
|
||||
|
||||
export default function WatchError({
|
||||
error,
|
||||
@@ -12,7 +12,7 @@ export default function WatchError({
|
||||
reset: () => void;
|
||||
}) {
|
||||
useEffect(() => {
|
||||
console.error("Watch page error:", error);
|
||||
console.error('Watch page error:', error);
|
||||
}, [error]);
|
||||
|
||||
return (
|
||||
@@ -26,17 +26,13 @@ export default function WatchError({
|
||||
<p className="text-muted-foreground max-w-md">
|
||||
We couldn't load this video. It may have been removed or the link might be incorrect.
|
||||
</p>
|
||||
{error.digest && (
|
||||
<p className="text-muted-foreground text-xs">
|
||||
Error ID: {error.digest}
|
||||
</p>
|
||||
)}
|
||||
{error.digest && <p className="text-muted-foreground text-xs">Error ID: {error.digest}</p>}
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<Button onClick={reset} variant="default">
|
||||
Try again
|
||||
</Button>
|
||||
<Button onClick={() => window.location.href = "/"} variant="outline">
|
||||
<Button onClick={() => (window.location.href = '/')} variant="outline">
|
||||
Go home
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Skeleton } from "@/components/ui/skeleton"
|
||||
import { Separator } from "@/components/ui/separator"
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
|
||||
function CommentSkeleton() {
|
||||
return (
|
||||
@@ -14,7 +14,7 @@ function CommentSkeleton() {
|
||||
<Skeleton className="h-4 w-full mb-1" />
|
||||
<Skeleton className="h-4 w-2/3" />
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export default function WatchLoading() {
|
||||
@@ -77,5 +77,5 @@ export default function WatchLoading() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Link from "next/link";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Film, XCircle } from "lucide-react";
|
||||
import Link from 'next/link';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Film, XCircle } from 'lucide-react';
|
||||
|
||||
export default function WatchNotFound() {
|
||||
return (
|
||||
@@ -12,7 +12,8 @@ export default function WatchNotFound() {
|
||||
</div>
|
||||
<h1 className="text-2xl font-bold">Video Not Found</h1>
|
||||
<p className="text-muted-foreground max-w-md">
|
||||
The video you're looking for doesn't exist, has been removed, or the link may be expired.
|
||||
The video you're looking for doesn't exist, has been removed, or the link may be
|
||||
expired.
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
|
||||
@@ -83,7 +83,10 @@ export async function POST(request: NextRequest, { params }: RouteParams) {
|
||||
const tokenForAttempt = shareTokenFromBody || pendingToken;
|
||||
|
||||
if (!tokenForAttempt) {
|
||||
return NextResponse.json({ error: 'Share session expired. Open the share link again.' }, { status: 401 });
|
||||
return NextResponse.json(
|
||||
{ error: 'Share session expired. Open the share link again.' },
|
||||
{ status: 401 }
|
||||
);
|
||||
}
|
||||
|
||||
// Additional throttle bound to token+IP to reduce password guessing against one link.
|
||||
|
||||
Reference in New Issue
Block a user