significant refactor
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import { useState, FormEventHandler, useMemo } from 'react';
|
||||
import { ArrowLeftIcon } from '@phosphor-icons/react';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { Autocomplete, Divider, Flex, Text, TextInput, Title, UnstyledButton } from '@mantine/core';
|
||||
import ExistingPlayerButton from './existing-player-button';
|
||||
import NewPlayerButton from './new-player-button';
|
||||
import { Player } from '@/features/players/types';
|
||||
import { toast } from 'sonner';
|
||||
import { playerQueries } from '@/features/players/queries';
|
||||
import toast from '@/lib/sonner'
|
||||
import { useUnassociatedPlayers } from '@/features/players/queries';
|
||||
import useCreateUser from '../../hooks/use-create-user';
|
||||
import Button from '@/components/button';
|
||||
|
||||
@@ -17,7 +16,7 @@ enum PlayerPromptStage {
|
||||
|
||||
const PlayerPrompt = () => {
|
||||
const [stage, setStage] = useState<PlayerPromptStage>();
|
||||
const playersQuery = useQuery(playerQueries.unassociated());
|
||||
const playersQuery = useUnassociatedPlayers();
|
||||
const { mutate: createUser, isPending } = useCreateUser();
|
||||
const players = playersQuery.data;
|
||||
const [player, setPlayer] = useState<Player>();
|
||||
|
||||
Reference in New Issue
Block a user