import React, { useState } from 'react'; import { GameStateClient, StateNight, StateRoleAssignment } from '../../types'; import '../styles/main.scss'; import { useSocketEvents } from '../hooks/useSocketEvents'; /** * Remove parentheses and their contents from a string. * @param input String containing parentheses * @returns String without any parentheses and their contents */ function removeParenthesesNaively(input: string): string { return input.replace(/\s*\([^)]*\)/g, ''); } interface OnubRoleAssignmentProps { stateRoleAssignment: StateRoleAssignment; currentPlayerId: string; } export const OnubRoleAssignment: React.FC = ({ stateRoleAssignment, currentPlayerId }) => { const { confirmRoleAssignment } = useSocketEvents(); const roleWithParentheses = stateRoleAssignment.playerData[currentPlayerId].originalRoleId; const role = removeParenthesesNaively(roleWithParentheses); return

Role Assignment

Your role is: {role}

; }