drafted-file.tsx
This file
Path
apps/web/src/features/proposal/drafted-file.tsx
37 lines · 913 bytes · TypeScript
Last changed by
Merge build/comments-web-features into mainoscabrielbefore adoption74bfc72
History of this fileTake it
Merge branch 'build/911-web-propose-and-proposal'oscabrielbefore adoptionbcb4cd9
lines 1–4why, one step back1import { File } from "@pierre/diffs/react";2import type { FileOptions } from "@pierre/diffs/react";3import { useMemo } from "react";4Draw text, controls, prose and code from one set of tokensoscabrielbefore adoption60f862e
line 5why, one step back5import { diffsOptions, registerCodeTheme } from "../code/pierre.ts";Fix the finish review's findings: drafted code draws, counts agree, commands hangoscabrielbefore adoptionf7f6e49
line 6why, one step back6import { CodePool } from "../code/pool.tsx";Draw text, controls, prose and code from one set of tokensoscabrielbefore adoption60f862e
lines 7–9why, one step back78registerCodeTheme();9Merge branch 'build/911-web-propose-and-proposal'oscabrielbefore adoptionbcb4cd9
lines 10–15why, one step back10export interface DraftedFileProps {11 readonly path: string;12 readonly content: string;13}1415const options: FileOptions<undefined, undefined> = {Draw text, controls, prose and code from one set of tokensoscabrielbefore adoption60f862e
line 16why, one step back16 ...diffsOptions,Finish the Control room: every page passes axe and a keyboard walk in both schemesoscabrielbefore adoption3fd50a5
line 17why, one step back17 disableFileHeader: true,Merge branch 'build/911-web-propose-and-proposal'oscabrielbefore adoptionbcb4cd9
lines 18–27why, one step back18 overflow: "scroll",19};2021export const DraftedFile = ({ content, path }: DraftedFileProps) => {22 const file = useMemo(23 () => ({ contents: content, name: path }),24 [content, path]25 );2627 return (Fix the finish review's findings: drafted code draws, counts agree, commands hangoscabrielbefore adoptionf7f6e49
lines 28–32why, one step back28 <CodePool>29 <div className="border-rule min-w-0 border" data-code="pierre">30 <File file={file} options={options} />31 </div>32 </CodePool>Merge branch 'build/911-web-propose-and-proposal'oscabrielbefore adoptionbcb4cd9
lines 33–37why, one step back33 );34};3536// `React.lazy` takes a module's default export.37export default DraftedFile;