import { Button, Card, Input, Tabs, Textarea } from "@geist-ui/core" import { ChangeEvent, FormEvent, memo, useEffect, useRef, useState } from "react" import styles from './document.module.css' import MarkdownPreview from '../preview' import { Trash } from '@geist-ui/icons' type Props = { editable: boolean remove?: () => void title?: string content?: string setTitle?: (title: string) => void setContent?: (content: string) => void } const Document = ({ remove, editable, title, content, setTitle, setContent }: Props) => { const codeEditorRef = useRef(null) const removeFile = (remove?: () => void) => { if (remove) { if (content && content.trim().length > 0) { const confirmed = window.confirm("Are you sure you want to remove this file?") if (confirmed) { remove() } } else { remove() } } } return (
) => setTitle ? setTitle(event.target.value) : null} marginTop="var(--gap-double)" size={1.2} font={1.2} label="Filename" disabled={!editable} width={"100%"} /> {remove && editable &&
{/* */}