MCPcopy Create free account
hub / github.com/anomalyco/opencode / createOverflow

Function createOverflow

packages/web/src/components/share/common.tsx:80–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78}
79
80export function createOverflow() {
81 const [overflow, setOverflow] = createSignal(false)
82 return {
83 get status() {
84 return overflow()
85 },
86 ref(el: HTMLElement) {
87 const sync = () => {
88 setOverflow(el.scrollHeight > el.clientHeight + 1)
89 }
90
91 const obs = makeResizeObserver(sync)
92 obs.observe(el)
93
94 sync()
95 },
96 }
97}
98
99export function formatDuration(ms: number, locale: string): string {
100 const normalized = normalizeLocale(locale)

Callers 4

ContentTextFunction · 0.90
ContentErrorFunction · 0.90
ContentMarkdownFunction · 0.90
ContentBashFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected