Skip to content

Commit

Permalink
refactor: Fix import statement in SetsView component
Browse files Browse the repository at this point in the history
  • Loading branch information
soy0ka committed Jun 16, 2024
1 parent ed7da62 commit 2f27a2b
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 677 deletions.
39 changes: 39 additions & 0 deletions src/components/setsCreate/AbilityAutocomplete.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import Autocomplete from '@mui/material/Autocomplete'
import TextField from '@mui/material/TextField'
import React from 'react'

interface Props {
abilities: { label: string }[]
ability: string
setAbility: (ability: string) => void

Check warning on line 8 in src/components/setsCreate/AbilityAutocomplete.tsx

View workflow job for this annotation

GitHub Actions / ESLint

'ability' is defined but never used
disabled: boolean
}

export const AbilityAutocomplete: React.FC<Props> = ({
abilities,
ability,
setAbility,
disabled,
}) => {
return (
<Autocomplete
id="ability"
disabled={disabled}
options={abilities}
value={{ label: ability }}
sx={{ width: '100%' }}
renderInput={(params) => (
<TextField
sx={{ '& > p': { color: 'red' } }}
label="특성"
{...params}
helperText={ability || disabled ? '' : '* 올바른 특성을 선택해주세요'}
/>
)}
onChange={(e, v) => {
if (!v) return
setAbility(v.label)
}}
/>
)
}
Loading

0 comments on commit 2f27a2b

Please sign in to comment.