Files
supabase/web/spec/gen/components/Example.ts
Yonathan Benolol 81afb0e1fb Added support for notes in Examples.
Also added a note about join tables in Select Reference.
2022-02-28 20:58:19 +02:00

25 lines
443 B
TypeScript

type params = { name: string; description: string; tabs: string; note: string; }
const Example = ({name, description = '', tabs = '', note = ''}: params) => {
if (note !== '') {
const [noteTitle, ...noteText] = note.split('\n');
console.log(noteText);
note = `
:::note ${noteTitle}
${noteText.join('\n')}
:::
`;
}
return `
### ${name}
${description}
${tabs}
${note}
`.trim()
}
export default Example