import { useEffect } from "react"; import { Link } from "react-router-dom"; import { Tabs, TabPane, Banner, Steps } from "@douyinfe/semi-ui"; import { IconDeleteStroked } from "@douyinfe/semi-icons"; import { db } from "../data/db"; import { useLiveQuery } from "dexie-react-hooks"; import Thumbnail from "../components/Thumbnail"; import logo_light from "../assets/logo_light_160.png"; import template_screenshot from "../assets/template_screenshot.png"; export default function Templates() { const defaultTemplates = useLiveQuery(() => db.templates.where({ custom: 0 }).toArray() ); const customTemplates = useLiveQuery(() => db.templates.where({ custom: 1 }).toArray() ); const deleteTemplate = async (id) => { await db.templates.delete(id); }; const editTemplate = (id) => { const newWindow = window.open("/reference/drawdb/editor", "_blank"); newWindow.name = "t " + id; }; const forkTemplate = (id) => { const newWindow = window.open("/reference/drawdb/editor", "_blank"); newWindow.name = "lt " + id; }; 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" >
{defaultTemplates?.map((t, i) => (
{t.title}
{t.description}
))}
Your templates} itemKey="2" > {customTemplates?.length > 0 ? (
{customTemplates?.map((c, i) => (
{c.title}
))}
) : (
You have no custom templates saved.
} />
How to save a template
)}

© 2024 drawDB - All right reserved.
); }