mirror of
https://github.com/supabase/supabase.git
synced 2026-06-28 11:33:52 -04:00
14 lines
333 B
TypeScript
14 lines
333 B
TypeScript
export const Admonition = ({
|
|
props,
|
|
children,
|
|
}: {
|
|
props: Record<string, unknown>
|
|
children: string
|
|
}): string => {
|
|
const type = props.type ? String(props.type) : 'note'
|
|
return `${capitalize(type)}: ${children}`
|
|
}
|
|
|
|
const capitalize = <T extends string>(s: T) =>
|
|
(s[0].toUpperCase() + s.slice(1)) as Capitalize<typeof s>
|