I needed a main element, that was using tailwind classes, so that everything inside that class, followed the same structure
38 lines
956 B
TypeScript
38 lines
956 B
TypeScript
import { StrictMode } from 'react'
|
|
import { createRoot } from 'react-dom/client'
|
|
import './index.css'
|
|
import App from "./App.tsx";
|
|
|
|
import initWasm from '@vlcn.io/crsqlite-wasm';
|
|
import wasmUrl from '@vlcn.io/crsqlite-wasm/crsqlite.wasm?url';
|
|
import tblrx from '@vlcn.io/rx-tbl';
|
|
|
|
const sqlite = await initWasm(() => wasmUrl);
|
|
|
|
const db = await sqlite.open("todo.db");
|
|
await db.exec(`
|
|
CREATE TABLE IF NOT EXISTS todos (
|
|
id BLOB PRIMARY KEY NOT NULL,
|
|
description TEXT,
|
|
project text,
|
|
tags text,
|
|
due text,
|
|
wait text,
|
|
priority text,
|
|
urgency real,
|
|
completed INTEGER NOT NULL DEFAULT 0
|
|
);
|
|
SELECT crsql_as_crr('todos');
|
|
`);
|
|
|
|
const rx = tblrx(db);
|
|
const ctx = { db, rx };
|
|
|
|
document.getElementById("root")!.classList.add("dark");
|
|
|
|
createRoot(document.getElementById("root") as HTMLElement).render(
|
|
<main className="min-h-screen flex flex-col py-12 bg-background text-gray-200">
|
|
<App ctx={ctx} />
|
|
</main>
|
|
);
|