remove unused variables

This commit is contained in:
Moriz Wahl 2025-02-25 10:13:04 +01:00
parent 8c356b0a44
commit 86c410768e
2 changed files with 1 additions and 28 deletions

View File

@ -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', () => {

View File

@ -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])