fix build error
This commit is contained in:
@@ -24,6 +24,25 @@ interface DrawingElement {
|
||||
strokeWidth?: number;
|
||||
}
|
||||
|
||||
interface Project {
|
||||
id: number;
|
||||
name: string;
|
||||
description?: string;
|
||||
user_id: string;
|
||||
created_at: string;
|
||||
updated_at?: string;
|
||||
}
|
||||
|
||||
interface Wireframe {
|
||||
id: number;
|
||||
project_id: number;
|
||||
name: string;
|
||||
description?: string;
|
||||
canvas_data?: DrawingElement[];
|
||||
created_at: string;
|
||||
updated_at?: string;
|
||||
}
|
||||
|
||||
export default function CanvasPage() {
|
||||
const [searchParams] = useSearchParams();
|
||||
const canvasRef = useRef<HTMLCanvasElement>(null);
|
||||
@@ -34,9 +53,9 @@ export default function CanvasPage() {
|
||||
const [generatedImageUrl, setGeneratedImageUrl] = useState<string | null>(null);
|
||||
const [isGenerating, setIsGenerating] = useState(false);
|
||||
const [elements, setElements] = useState<DrawingElement[]>([]);
|
||||
const [currentProject, setCurrentProject] = useState<any>(null);
|
||||
const [currentWireframe, setCurrentWireframe] = useState<any>(null);
|
||||
const [projects, setProjects] = useState<any[]>([]);
|
||||
const [currentProject, setCurrentProject] = useState<Project | null>(null);
|
||||
const [currentWireframe, setCurrentWireframe] = useState<Wireframe | null>(null);
|
||||
const [projects, setProjects] = useState<Project[]>([]);
|
||||
const [wireframeName, setWireframeName] = useState("Untitled Wireframe");
|
||||
const [isSaving, setIsSaving] = useState(false);
|
||||
|
||||
@@ -211,9 +230,9 @@ export default function CanvasPage() {
|
||||
if (userProjects && userProjects.length > 0) {
|
||||
setProjects(userProjects);
|
||||
// Use specified project or first one
|
||||
let project;
|
||||
let project: Project | undefined;
|
||||
if (projectIdFromUrl) {
|
||||
project = userProjects.find(p => p.id === parseInt(projectIdFromUrl));
|
||||
project = userProjects.find((p: Project) => p.id === parseInt(projectIdFromUrl));
|
||||
}
|
||||
if (!project) {
|
||||
project = userProjects[0];
|
||||
|
||||
Reference in New Issue
Block a user