import { Button } from 'react-bootstrap' import Link from 'next/link' import { useRouter } from 'next/router' import Nav from 'react-bootstrap/Nav' import { useState } from 'react' import { Form, Input, SubmitButton } from './form' import InputGroup from 'react-bootstrap/InputGroup' import * as Yup from 'yup' import { gql, useApolloClient, useMutation } from '@apollo/client' import styles from './user-header.module.css' import { useMe } from './me' const NAME_QUERY = gql` query nameAvailable($name: String!) { nameAvailable(name: $name) } ` const NAME_MUTATION = gql` mutation setName($name: String!) { setName(name: $name) } ` export default function UserHeader ({ user }) { const [editting, setEditting] = useState(false) const me = useMe() const router = useRouter() const client = useApolloClient() const [setName] = useMutation(NAME_MUTATION) const isMe = me?.name === user.name const Satistics = () =>