import { JSONEditor } from '@repo/view-builder/json-editor/JSONEditor';
const customActions = [
{
label: 'Generate Types',
icon: 'code',
action: (schema) => {
// Generate TypeScript types from schema
console.log('Generating types for schema:', schema);
}
},
{
label: 'Export to File',
icon: 'download',
action: (schema) => {
// Export schema to file
const blob = new Blob([JSON.stringify(schema, null, 2)], { type: 'application/json' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'schema.json';
a.click();
}
}
];
function ActionableEditor() {
return <JSONEditor customActions={customActions} />;
}