diff --git a/bun.lockb b/bun.lockb index 5187839..31f7911 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 86947a1..f943043 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "preview": "vite preview" }, "dependencies": { + "@ckeditor/ckeditor5-react": "^9.3.0", "@tanstack/react-form": "^0.33.0", "@tanstack/react-router": "^1.62.0", "appwrite": "^16.0.2", diff --git a/src/components/Card.tsx b/src/components/Card.tsx index 37aa0c3..f862969 100644 --- a/src/components/Card.tsx +++ b/src/components/Card.tsx @@ -1,12 +1,14 @@ import classNames from 'classnames'; +import { PencilIcon } from './icons'; interface CardProps { title: string; - description: string; + description?: string; onClick?: () => void; + onEdit?: () => void; } -const Card: React.FC = ({ title, description, onClick }) => { +const Card: React.FC = ({ title, description, onClick, onEdit }) => { const className = classNames( 'p-4 border rounded-lg shadow-sm transition', { @@ -19,8 +21,22 @@ const Card: React.FC = ({ title, description, onClick }) => { return (
-

{title}

-

{description}

+
+

{title}

+ {onEdit && ( + + )} +
+ {description &&

{description}

}
); }; diff --git a/src/components/Drawer.tsx b/src/components/Drawer.tsx index 5d32b90..3a93a3d 100644 --- a/src/components/Drawer.tsx +++ b/src/components/Drawer.tsx @@ -32,7 +32,7 @@ const Drawer: React.FC = ({ isOpen, onClose, children }) => {
= ({ body, className }) => { + if (!body) { + return null; + } + + const styles = ` + body { + font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; + line-height: 1.5; + font-weight: 400; + + color-scheme: light dark; + color: rgba(255, 255, 255, 0.87); + background-color: #242424; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + + overflow-y: hidden; + } + + @media (prefers-color-scheme: light) { + body { + color: #213547; + background-color: #ffffff; + } + } + + html:not(.x),body:not(.x){height:auto!important} + p:first-child{margin-top:0;} + p:last-child{margin-bottom:0;} + a[href]{color: #3781B8;text-decoration:none;} + a[href]:hover{text-decoration:underline;} + blockquote[type=cite] {margin:0 0 0 .8ex;border-left: 1px #ccc solid;padding-left: 1ex;} + img { max-width: 100%; } + ul, ol { padding: 0; margin: 0 0 10px 25px; } + ul { list-style-type: disc; }`; + + const cnt = ` + + + + + + + ${body} + `; + + const props = { + csp: "script-src 'none'", + }; + + return ( +