mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
cleanup
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef } from "react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useParams, useRouter } from "next/navigation";
|
||||
import {
|
||||
ResizablePanelGroup,
|
||||
@@ -16,6 +16,7 @@ import { usePanelStore } from "@/stores/panel-store";
|
||||
import { useProjectStore } from "@/stores/project-store";
|
||||
import { EditorProvider } from "@/components/editor-provider";
|
||||
import { usePlaybackControls } from "@/hooks/use-playback-controls";
|
||||
import { Onboarding } from "@/components/onboarding";
|
||||
|
||||
export default function Editor() {
|
||||
const {
|
||||
@@ -36,12 +37,12 @@ export default function Editor() {
|
||||
const router = useRouter();
|
||||
const projectId = params.project_id as string;
|
||||
const handledProjectIds = useRef<Set<string>>(new Set());
|
||||
const [isOnboardingOpen, setIsOnboardingOpen] = useState(true);
|
||||
|
||||
usePlaybackControls();
|
||||
|
||||
useEffect(() => {
|
||||
const initProject = async () => {
|
||||
|
||||
if (!projectId) return;
|
||||
|
||||
if (activeProject?.id === projectId) {
|
||||
@@ -139,6 +140,12 @@ export default function Editor() {
|
||||
</ResizablePanelGroup>
|
||||
</div>
|
||||
</div>
|
||||
<Onboarding
|
||||
isOpen={isOnboardingOpen}
|
||||
onClose={() => {
|
||||
setIsOnboardingOpen(false);
|
||||
}}
|
||||
/>
|
||||
</EditorProvider>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
"use client";
|
||||
"use client"
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import Link from "next/link";
|
||||
import { useState } from "react";
|
||||
import React, { useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
@@ -28,8 +29,15 @@ import { useProjectStore } from "@/stores/project-store";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { DeleteProjectDialog } from "@/components/delete-project-dialog";
|
||||
import { RenameProjectDialog } from "@/components/rename-project-dialog";
|
||||
import { toast } from "sonner";
|
||||
|
||||
export default function ProjectsPage() {
|
||||
|
||||
if (process.env.NODE_ENV !== "development") {
|
||||
toast.error("You are not allowed to access this page");
|
||||
redirect("/");
|
||||
}
|
||||
|
||||
const {
|
||||
createNewProject,
|
||||
savedProjects,
|
||||
|
||||
Reference in New Issue
Block a user