Skip to content

Commit

Permalink
feat(28664): add remove schema
Browse files Browse the repository at this point in the history
  • Loading branch information
vanch3d committed Dec 9, 2024
1 parent 1007b0a commit fef16ff
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ const TopicSchemaManager: FC<CurrentSchemaProps> = ({ topicFilter }) => {
onUpdate(topicFilter.topicFilter, { ...topicFilter, schema: dataUri })
}

const onHandleClear = () => {
onUpdate(topicFilter.topicFilter, { ...topicFilter, schema: undefined })
}

return (
<VStack>
<ErrorMessage message={schemaHandler.error} status={schemaHandler.status} type={schemaHandler.message} />
Expand All @@ -64,7 +68,9 @@ const TopicSchemaManager: FC<CurrentSchemaProps> = ({ topicFilter }) => {
<JsonSchemaBrowser schema={schemaHandler.schema} />
</CardBody>
<CardFooter justifyContent="flex-end">
<Button isDisabled>{t('topicFilter.schema.actions.remove')}</Button>
<Button isDisabled={Boolean(!topicFilter.schema)} onClick={onHandleClear}>
{t('topicFilter.schema.actions.remove')}
</Button>
</CardFooter>
</Card>
)}
Expand Down

0 comments on commit fef16ff

Please sign in to comment.