11import { InputBase } from '@mui/material'
2- import React , { useCallback } from 'react'
2+ import type { ChangeEventHandler , ComponentType , FC } from 'react'
3+ import { memo , useCallback } from 'react'
34
45import { useJsonViewerStore } from '../../stores/JsonViewerStore'
56import type { Colorspace } from '../../theme/base16'
@@ -9,7 +10,7 @@ import { DataBox } from '../mui/DataBox'
910
1011export function createEasyType < Value > (
1112 type : string ,
12- renderValue : React . ComponentType < Pick < DataItemProps < Value > , 'value' > > ,
13+ renderValue : ComponentType < Pick < DataItemProps < Value > , 'value' > > ,
1314 config : {
1415 colorKey : keyof Colorspace
1516 fromString ?: ( value : string ) => Value
@@ -18,8 +19,8 @@ export function createEasyType<Value> (
1819) : Omit < DataType < Value > , 'is' > {
1920 const { fromString, colorKey, displayTypeLabel = true } = config
2021
21- const Render = React . memo ( renderValue )
22- const EasyType : React . FC < DataItemProps < Value > > = ( props ) => {
22+ const Render = memo ( renderValue )
23+ const EasyType : FC < DataItemProps < Value > > = ( props ) => {
2324 const storeDisplayDataTypes = useJsonViewerStore ( store => store . displayDataTypes )
2425 const color = useJsonViewerStore ( store => store . colorspace [ colorKey ] )
2526 const onSelect = useJsonViewerStore ( store => store . onSelect )
@@ -41,13 +42,13 @@ export function createEasyType<Value> (
4142 }
4243 }
4344
44- const EasyTypeEditor : React . FC < EditorProps < Value > > = ( { value, setValue } ) => {
45+ const EasyTypeEditor : FC < EditorProps < Value > > = ( { value, setValue } ) => {
4546 const color = useJsonViewerStore ( store => store . colorspace [ colorKey ] )
4647 return (
4748 < InputBase
4849 value = { value }
4950 onChange = {
50- useCallback < React . ChangeEventHandler < HTMLTextAreaElement | HTMLInputElement > > (
51+ useCallback < ChangeEventHandler < HTMLTextAreaElement | HTMLInputElement > > (
5152 ( event ) => {
5253 const value = fromString ( event . target . value )
5354 setValue ( value )
0 commit comments