import { useRecoilValue } from 'recoil'; import { peopleEmailFamilyState } from '@/people/states/peopleEmailFamilyState'; import { EditableCellText } from '@/ui/table/editable-cell/types/EditableCellText'; import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId'; import { useUpdateOnePersonMutation } from '~/generated/graphql'; export function EditablePeopleEmailCell() { const currentRowEntityId = useCurrentRowEntityId(); const [updatePerson] = useUpdateOnePersonMutation(); const email = useRecoilValue( peopleEmailFamilyState(currentRowEntityId ?? ''), ); return ( updatePerson({ variables: { where: { id: currentRowEntityId, }, data: { email: newEmail, }, }, }) } /> ); }