0.0.2.0
This commit is contained in:
@@ -28,18 +28,9 @@ export function FamilyTreesList() {
|
||||
|
||||
useEffect(() => {
|
||||
if (session?.user?.id) {
|
||||
console.log('📋 开始获取家族树列表...')
|
||||
fetch('/api/trees')
|
||||
.then(res => {
|
||||
console.log('📋 家族树列表响应状态:', res.status)
|
||||
return res.json()
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
console.log('📋 家族树列表数据:', {
|
||||
data,
|
||||
treesCount: data.trees?.length,
|
||||
trees: data.trees
|
||||
})
|
||||
if (data.trees) {
|
||||
setTrees(data.trees)
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ import { useState, useEffect } from "react"
|
||||
import { db } from "@/lib/db"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Card } from "@/components/ui/card"
|
||||
import { X, Upload, Image as ImageIcon } from "lucide-react"
|
||||
import { uploadImage } from "@/lib/image-upload"
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog"
|
||||
import { X, Upload, Image as ImageIcon, Plus, ZoomIn } from "lucide-react"
|
||||
import { useDialog } from "@/components/ui/alert-dialog-custom"
|
||||
import { v4 as uuidv4 } from "uuid"
|
||||
import imageCompression from "browser-image-compression"
|
||||
|
||||
@@ -6,6 +6,7 @@ import { Input } from "@/components/ui/input"
|
||||
import { Textarea } from "@/components/ui/textarea"
|
||||
import { Label } from "@/components/ui/label"
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from "@/components/ui/dialog"
|
||||
import { Plus, Edit, Trash, BookOpen, Calendar } from "lucide-react"
|
||||
import type { FamilyStory } from "@/types/family"
|
||||
import { v4 as uuidv4 } from "uuid"
|
||||
@@ -19,7 +20,7 @@ interface StoryManagerProps {
|
||||
|
||||
export function StoryManager({ stories = [], onChange, readonly = false }: StoryManagerProps) {
|
||||
const { showAlert, showConfirm } = useDialog()
|
||||
const [isEditing, setIsEditing] = useState(false)
|
||||
const [isDialogOpen, setIsDialogOpen] = useState(false)
|
||||
const [editingStory, setEditingStory] = useState<FamilyStory | null>(null)
|
||||
const [formData, setFormData] = useState<Partial<FamilyStory>>({
|
||||
title: "",
|
||||
|
||||
Reference in New Issue
Block a user