Files
supabase/apps/www/components/code-display.tsx
Saxon Fletcher 7af346d185 Feat/realtime examples (#34317)
* realtime examples

* more examples

* styling updates

* use broadcast from database for todos

* updated realtime examples

* update layout

* clean up

* turbo

* update example structure

* remove context

* remove text from example

* realtime migration

* Smol fix

* Update

* Update

* Final fix

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-04-02 11:00:27 +10:00

24 lines
576 B
TypeScript

'use client'
import React from 'react'
type CodeDisplayProps = {
code: string
title?: string
}
export default function CodeDisplay({ code, title = 'Code' }: CodeDisplayProps) {
return (
<div className="h-full flex flex-col">
<div className="bg-neutral-900 border-b border-neutral-700/50 text-neutral-400 text-xs py-2 px-4">
{title}
</div>
<div className="bg-neutral-900 p-4 overflow-auto flex-1">
<pre className="text-xs text-neutral-300 overflow-auto">
<code>{code}</code>
</pre>
</div>
</div>
)
}