working team update/create (still need enroll)
This commit is contained in:
@@ -11,9 +11,8 @@ const TeamSelectionView: React.FC<TeamSelectionViewProps> = React.memo(({
|
||||
options,
|
||||
onSelect
|
||||
}) => {
|
||||
const [value, setValue] = useState<string>();
|
||||
const selectedOption = useMemo(() => options.find(option => option.label === value), [value])
|
||||
|
||||
const [value, setValue] = useState<string>('');
|
||||
const selectedOption = useMemo(() => options.find(option => option.label === value), [value, options])
|
||||
|
||||
const handleCreateNewTeamClicked = () => onSelect(undefined);
|
||||
const handleSelectExistingTeam = () => onSelect(selectedOption?.value)
|
||||
@@ -28,19 +27,19 @@ const TeamSelectionView: React.FC<TeamSelectionViewProps> = React.memo(({
|
||||
>
|
||||
Create New Team
|
||||
</Button>
|
||||
|
||||
|
||||
<Divider my="sm" label="or" />
|
||||
|
||||
|
||||
<Stack gap="sm">
|
||||
<Autocomplete
|
||||
placeholder="Select one of your existing teams"
|
||||
value={selectedOption?.label || ''}
|
||||
value={value}
|
||||
onChange={setValue}
|
||||
data={options.map(option => option.label)}
|
||||
comboboxProps={{ withinPortal: false }}
|
||||
/>
|
||||
|
||||
<Button
|
||||
|
||||
<Button
|
||||
onClick={handleSelectExistingTeam}
|
||||
disabled={!selectedOption}
|
||||
fullWidth
|
||||
|
||||
Reference in New Issue
Block a user