mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2026-03-01 12:44:17 +00:00
remove unused variables
This commit is contained in:
parent
8c356b0a44
commit
86c410768e
@ -1,8 +1,6 @@
|
||||
import { render, screen, fireEvent } from '@testing-library/react'
|
||||
import { describe, it, expect, beforeEach, vi } from 'vitest'
|
||||
|
||||
import { TagsProvider } from '#components/Map/hooks/useTags'
|
||||
|
||||
import { TextAreaInput } from './TextAreaInput'
|
||||
|
||||
describe('<TextAreaInput />', () => {
|
||||
@ -12,19 +10,7 @@ describe('<TextAreaInput />', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
wrapper = render(
|
||||
<TagsProvider
|
||||
initialTags={[
|
||||
{
|
||||
color: '#b3242f',
|
||||
id: '03b41b63-4530-4754-95cf-0abf8f9db476',
|
||||
name: 'Feuer',
|
||||
},
|
||||
]}
|
||||
>
|
||||
<TextAreaInput defaultValue={''} updateFormValue={updateFormValue} />
|
||||
</TagsProvider>,
|
||||
)
|
||||
wrapper = render(<TextAreaInput defaultValue={''} updateFormValue={updateFormValue} />)
|
||||
})
|
||||
|
||||
it('renders properly', () => {
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
|
||||
import { useTags } from '#components/Map/hooks/useTags'
|
||||
|
||||
interface TextAreaProps {
|
||||
labelTitle?: string
|
||||
labelStyle?: string
|
||||
@ -14,8 +12,6 @@ interface TextAreaProps {
|
||||
updateFormValue?: (value: string) => void
|
||||
}
|
||||
|
||||
type KeyValue = Record<string, string>
|
||||
|
||||
/**
|
||||
* @category Input
|
||||
*/
|
||||
@ -33,15 +29,6 @@ export function TextAreaInput({
|
||||
const ref = useRef<HTMLTextAreaElement>(null)
|
||||
const [inputValue, setInputValue] = useState<string>(defaultValue)
|
||||
|
||||
const tags = useTags()
|
||||
|
||||
// Why this variable? It seems not to be used at all
|
||||
const values: KeyValue[] = []
|
||||
|
||||
tags.forEach((tag) => {
|
||||
values.push({ key: tag.name, value: tag.name, color: tag.color })
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
setInputValue(defaultValue)
|
||||
}, [defaultValue])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user