"use client" import type React from "react" import { SiteHeader } from "@/components/site-header" import { TreeLayout } from "@/components/tree/tree-layout" import { useFamily } from "@/context/family-context" import { Button } from "@/components/ui/button" import { ZoomIn, ZoomOut, Move, Filter } from "lucide-react" import { useState, useRef } from "react" export default function TreePage() { const { treeData } = useFamily() const [scale, setScale] = useState(1) const [position, setPosition] = useState({ x: 0, y: 0 }) const [isDragging, setIsDragging] = useState(false) const [startPos, setStartPos] = useState({ x: 0, y: 0 }) const containerRef = useRef(null) const handleMouseDown = (e: React.MouseEvent) => { setIsDragging(true) setStartPos({ x: e.clientX - position.x, y: e.clientY - position.y }) } const handleMouseMove = (e: React.MouseEvent) => { if (!isDragging) return setPosition({ x: e.clientX - startPos.x, y: e.clientY - startPos.y, }) } const handleMouseUp = () => { setIsDragging(false) } // Handle root not found if (!treeData.rootId) { return (
No family tree data found.
) } return (
{/* Toolbar */}
{/* Tree Canvas */}
) }