import React, { useEffect } from "react"; import logo_light from "../assets/logo_light_46.png"; import { Link } from "react-router-dom"; import { Tabs, TabPane } from "@douyinfe/semi-ui"; import { useLiveQuery } from "dexie-react-hooks"; import { db } from "../data/db"; function cardCanvas(diagram) { return (
{/* {diagram.areas.map((a) => ( {}} setResize={null} initCoords={null} setInitCoords={null} zoom={null} > ))} */} {diagram.tables.map((table, i) => { const height = table.fields.length * 36 + 50 + 7; return (
{table.name}
{table.fields.map((f, j) => (
{f.name}
{f.type}
))}
); })} {/* {diagram.relationships.map((e, i) => ( ))} {diagram.notes.map((n) => ( {} } > ))} */}
); } export default function Templates() { const templates = useLiveQuery(() => db.templates.toArray()); useEffect(() => { document.title = "Templates | drawDB"; }, []); return (
logo
Templates

Database schema templates
A compilation of database entity relationship diagrams to give you a quick start or inspire your application's architecture.
Default templates} itemKey="1" >
{templates?.map((t, i) => (
{cardCanvas(t)}
{t.title}
{t.description}
))}
Your templates} itemKey="2" > Your templates
); }