This commit is contained in:
Aarni Koskela
2022-02-11 16:54:44 +02:00
parent 5c237084f5
commit a4a04f1dac
14 changed files with 172 additions and 224 deletions

View File

@@ -25,8 +25,10 @@ function renderStringWithChannelRefs(value: string) {
export const ChannelReferenceRenderer = ({
children,
}: React.PropsWithChildren<{}>) => {
// TODO: this should probably walk the tree
if (typeof children[0] === "string")
return renderStringWithChannelRefs(children[0]);
// TODO: this must be made sound
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const c0 = children[0];
if (typeof c0 === "string") return renderStringWithChannelRefs(c0);
return <>{children}</>;
};