import React from 'react' import type { Language } from 'prism-react-renderer' import CodeBlock from '../MDX/CodeBlock' export interface Props { syntax: Language text: string className?: string } export function FileText({ syntax, text, className }: Props) { if (typeof text !== 'string') { return (
{`FileText Error: component receives invalid props.
If you use it in jsx, you should import text with "import text from './path/to/file.ts?raw'" and use it like " "
If you use it in markdown, you should use it exactly like " " (we use simple regexp to parse it, so you should use this format strictly)
`}
)
}
return (