mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-19 03:58:30 +02:00
Inline code + effect clarity (#2715)
* cleaner code blocks + form context * cleaner * nit
This commit is contained in:
@@ -55,32 +55,33 @@ export const CodeBlock = memo(function CodeBlock({
|
||||
</div>
|
||||
);
|
||||
|
||||
if (typeof children === "string") {
|
||||
return (
|
||||
<span
|
||||
className={`
|
||||
font-mono
|
||||
text-gray-800
|
||||
bg-gray-50
|
||||
border
|
||||
border-gray-300
|
||||
rounded
|
||||
align-bottom
|
||||
px-1
|
||||
py-[3px]
|
||||
text-xs
|
||||
inline-block
|
||||
whitespace-pre-wrap
|
||||
break-words
|
||||
${className}
|
||||
`}
|
||||
>
|
||||
{children}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
const CodeContent = () => {
|
||||
if (!language) {
|
||||
if (typeof children === "string") {
|
||||
return (
|
||||
<code
|
||||
className={`
|
||||
font-mono
|
||||
text-gray-800
|
||||
bg-gray-50
|
||||
border
|
||||
border-gray-300
|
||||
rounded
|
||||
px-1
|
||||
py-[3px]
|
||||
text-xs
|
||||
whitespace-pre-wrap
|
||||
break-words
|
||||
overflow-hidden
|
||||
mb-1
|
||||
${className}
|
||||
`}
|
||||
>
|
||||
{children}
|
||||
</code>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<pre style={CODE_BLOCK_PADDING}>
|
||||
<code className={`text-sm ${className}`}>
|
||||
|
@@ -74,7 +74,7 @@ export const EmbeddingFormProvider: React.FC<{
|
||||
if (stepFromUrl !== formStep) {
|
||||
setFormStep(stepFromUrl);
|
||||
}
|
||||
}, [searchParams, formStep]);
|
||||
}, [searchParams]);
|
||||
|
||||
const contextValue: EmbeddingFormContextType = {
|
||||
formStep,
|
||||
|
@@ -73,7 +73,7 @@ export const FormProvider: React.FC<{
|
||||
if (stepFromUrl !== formStep) {
|
||||
setFormStep(stepFromUrl);
|
||||
}
|
||||
}, [searchParams, formStep]);
|
||||
}, [searchParams]);
|
||||
|
||||
const contextValue: FormContextType = {
|
||||
formStep,
|
||||
|
Reference in New Issue
Block a user