import { getCanvasData } from "@/app/actions/fetchers";
import { AnimatePresence, motion } from "framer-motion";
import Link from "next/link";
import {
EllipsisHorizontalCircleIcon,
TrashIcon,
PencilSquareIcon,
} from "@heroicons/react/24/outline";
import { toast } from "sonner";
import { Label } from "@repo/ui/shadcn/label";
const childVariants = {
hidden: { opacity: 0, y: 10, filter: "blur(2px)" },
visible: { opacity: 1, y: 0, filter: "blur(0px)" },
};
export default function ThinkPad({
title,
description,
image,
id,
}: {
title: string;
description: string;
image: string;
id: string;
}) {
const [deleted, setDeleted] = useState(false);
const [info, setInfo] = useState({ title, description });
return (
{!deleted && (
Loading...
}
>
{info.title}
{info.description}
)}
);
}
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@repo/ui/shadcn/popover";
function Menu({
info,
id,
setDeleted,
setInfo,
}: {
info: { title: string; description: string };
id: string;
setDeleted: () => void;
setInfo: ({
title,
description,
}: {
title: string;
description: string;
}) => void;
}) {
return (
);
}
function EditToolbar({
id,
setInfo,
info,
}: {
id: string;
setInfo: ({
title,
description,
}: {
title: string;
description: string;
}) => void;
info: {
title: string;
description: string;
};
}) {
const [open, setOpen] = useState(false);
return (
);
}
import { Suspense, memo, use, useState } from "react";
import { Box, TldrawImage } from "tldraw";
import { Button } from "@repo/ui/shadcn/button";
import { AddCanvasInfo, deleteCanvas } from "@/app/actions/doers";
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@repo/ui/shadcn/dialog";
import { Input } from "@repo/ui/shadcn/input";
import { Textarea } from "@repo/ui/shadcn/textarea";
import { textCardUtil } from "@/components/canvas/textCard";
import { twitterCardUtil } from "@/components/canvas/twitterCard";
const ImageComponent = memo(({ id }: { id: string }) => {
const snapshot = use(getCanvasData(id));
if (snapshot.bounds) {
const pageBounds = new Box(
snapshot.bounds.x,
snapshot.bounds.y,
snapshot.bounds.w,
snapshot.bounds.h,
);
return (
);
}
return (
Drew things to seee here
);
});