-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Fix import statement in SetsView component
- Loading branch information
Showing
5 changed files
with
108 additions
and
677 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
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) | ||
}} | ||
/> | ||
) | ||
} |
Oops, something went wrong.