Player Of The Match Results

Welcome to Player of The Match Results Management Widget. The widget allows Fans United staff members to view and analyze player voting results from football matches. It provides a comprehensive interface for filtering matches by competitions and teams, displaying detailed player statistics, and includes features for viewing vote distribution among players. You can use this widget as it is and embed it in your platform, or you can use the Management Panel.

Installation and usage

The easiest way to use fansunited-widget-potm-results-management is to install it from npm as follows:

npm  install  fansunited-widget-potm-results

or:

yarn  add  fansunited-widget-potm-results

Here is an example how you can integrate Fans United Either/Or Management Widget:

import  'fansunited-widget-potm-results/style.css';
import { PotmResults } from  'fansunited-widget-potm-results';

const  App = () => {
return (
<PotmResults
	fansUnitedApiKey={'your-api-key'}
	fansUnitedClientId={'your-client-id'} />
);
}

Notes

  • The widget is bundled as a React component and its usage is as simple as the above example

  • Don't worry about your project's CSS. The widget's styling is done with Joy UI which is based on headless unstyle react components. This means that the widget's CSS will NOT affect yours. One important thing is that you need to import style.css file from package folder:

import 'fansunited-widget-potm-results/style.css';

N.B: If you are using an entry point for importing all your stylings, you need to import fansunited-widget-potm-results/style.css there as well

Props

type  PotmResultsManagerProps = {
	fansUnitedApiKey: string;
	fansUnitedClientId: string;
	fansUnitedLanguage?: string;
	fansUnitedEnvironment?: string;
	labels?: LabelsModel;
};

Fans United Player Of The Match Results Management Widget depends on Fans United JS SDK and Fans United Client API. Thats why fansUnitedApiKey and fansUnitedClientId are required. They will be provided to you from Fans United team. For other optional props here is some information:

  • fansUnitedLanguage - for our sports APIs FansUnited platform supports different languages. For now they are Bulgarian (bg), English (en), Romanian (ro), Greek (el), Slovak (sk), Serbian (sr) and Hungarian (hu). If no value given it will be set to English (en).

  • fansUnitedEnvironment - You can run the widget in the following environments: staging, production, watg and yolo. If no value given it will be set to production (prod).

  • labels - you can easily translate all labels, UI messages, descriptions, placeholders and etc. with this prop. By default, Fans United Match Quiz Management Widget is available in English so if no value is given, the widget will be translated in English.

Translation

You can easily translate Fans United Player Of The Match Results Management Widget in your language! You just need to pass an object to labels prop with concrete keys and values and that's it! Here's an example how you can do it:

import  'fansunited-widget-potm-results/style.css';
import { PotmResults } from  'fansunited-widget-potm-results';

const  labels = {
	clientConfigErrorMessage: "There was a problem fetching client's configuration. Please check again your API key and client ID. For more information contact Fans United staff.",
  searchCompetitions: 'Search competitions',
  competitionsSelectionPlaceholder: 'Search for competitions by their name',
  competitionsErrorMessage: 'There was a problem with fetching competitions information',
  searchTeams: 'Search teams',
  teamsSelectionPlaceholder: 'Search for teams by their name',
  searchTeamsErrorMessage: 'There was a problem searching for teams',
  fetchMatchesErrorMessage: 'There was a problem while fetching matches. Please try again.',
  noMatchesFound: 'No matches found',
  itemsPerPage: 'Items per page',
  fromDate: 'From date',
  toDate: 'To date',
  timeFormat: 'DD MMM YYYY HH:mm',
  fetchPotmResultsErrorMessage: 'There was a problem with fetching "Player of The Match" results for match: ${matchName}',
  noPotmStandingsAvailable: 'No Player of The Match standings available',
  totalVotes: 'Total votes',
  playerOfTheMatchStandings: 'Player of the match standings',
  player: 'Player',
  votes: 'Votes',
  winner: 'Winner',
  action: 'Action',
  showStatistics: 'Show statistics',
  close: 'Close',
  minutesPlayed: 'Minutes played',
  yellowCards: 'Yellow cards',
  redCards: 'Red cards',
  goals: 'Goals',
  penaltyGoals: 'Penalty goals',
  penaltyCommitted: 'Penalties commited',
  penaltyWon: 'Penalties won',
  penaltyMissed: 'Penalties missed',
  penaltyReceived: 'Penalties received',
  penaltySaved: 'Penalties saved',
  ownGoals: 'Own goals',
  assists: 'Assists',
  cleanSheets: 'Clean sheets',
  shots: 'Shots',
  shotsOn: 'Shots on target',
  shotsBlocked: 'Shots blocked',
  offsides: 'Offsides',
  foulsCommitted: 'Fouls committed',
  foulsWon: 'Fouls won',
  tackles: 'Tackles',
  tacklesBlocks: 'Tackles blocked',
  tacklesInterceptions: 'Tackles interceptions',
  concededGoals: 'Conceded goals',
  caughtBall: 'Gaught balls',
  saves: 'Saves',
  passes: 'Passes',
  crosses: 'Crosses',
  interceptions: 'Interceptions',
  keyPasses: 'Key passes',
  passesAccuracy: 'Passes accuracy',
  duels: 'Duels',
  duelsWon: 'Duels won',
  dribblesAttempts: 'Dribbles attempts',
  dribblesSuccess: 'Dribbles success',
  dribblesPast: 'Dribbles past',
  widgetEmbedCode: 'Widget embed code',
  votingWindow: 'Voting window',
  votingWindowInfo: 'Determines how many hours after the finish time will voting remain open.',
  copyToClipboard: 'Copy to clipboard',
  divElementTextInfo: "The generated embed code can be copied directly into your website's HTML. For comprehensive implementation details, visit our documentation: ",
  warningTooltipInvalidMatchStatusMessage: `This match is currently with status: "__matchStatus__". The "Player of the Match" widget embed code will not work properly until the match status change to "not started" or "finished".`,
  dataProvider: "Data provider",
  dataProviderDescription: "Select the data source for match identification.",
  dataProviderRemappingIdNotFoundMessage: "No football entity ID was found for the selected provider.",
  dataProviderRemappingErrorMessage: "There was a problem with mapping football entity ID. Please try again.",
  playersToShow: "Players to show",
  all: "All",
  playersToShowDescription: "Choose which team’s players to include in the widget.",
  embedWidgetInfo: "Embed widget information",
  urlCopiedToClipboardMessage: "URL copied to clipboard",
  imageDeletedMessage: "Image deleted",
  imageResetMessage: "The initial size of the image has been restored",
  uploadingImageMessage: "You have successfully uploaded image",
  generateSignedInUrlErrorMessage: "There was a problem generating signed in URL to store the image in bucket. Please try again",
  uploadingImageErrorMessage: "There was a problem with uploading image to bucket. Please try again",
  encryptingImageErrorMessage: "There was a problem with encrypting image before uploading it to bucket. Please try again",
  searchSportal365ImagesErrorMessage: "There was a problem with searching images from Sportal 365 API. Please try again",
  clearImage: "Clear image",
  viewImage: "View image",
  cropImage: "Crop image",
  uploadImage: "Upload image",
  copyUrl: "Copy URL",
  sportal365Images: "Sportal365 images",
  hideFilters: "Hide filters",
  showFilters: "Show filters",
  search: "Search",
  aspectRatio: "Aspect ratio",
  crop: "Crop",
  reset: "Reset",
  getPlayersErrorMessage: "There was a problem fetching players. Please try again.",
  specificPlayers: "Specific players",
  specificPlayersDescription: "Select specific players to display in the widget. If no players are selected, all players from the chosen team(s) will be available for voting.",
  brandingArea: "Branding area",
  image: "Image",
  url: "URL",
  brandingUrlTooltip: "URL that the branding area will link to when clicked. Opens in a new tab.",
  authRequirement: "Auth requirement",
  authRequirementDescription: "Determines who can participate in voting. 'None' allows anonymous users, while 'Registered' requires user authentication.",
  signInLabel: "Label",
  signInLabelDescription: "Custom text displayed on the sign-in button. If empty, defaults to 'Sign in to vote'.",
  authenticationHandler: "Authentication handler",
  authenticationHandlerDescription: "JavaScript function code that executes when users click the sign-in button. To evaluate the function, provide only the function name. Example: showLoginModal() or window.openAuth(). The function is required otherwise the sign-in button will just log dummy message in the console.",
};

const  App = () => {
return (
<PotmResults
	fansUnitedApiKey={'your-api-key'}
	fansUnitedClientId={'your-client-id'}
	labels={labels}/>
);
}

Here is all information about LabelsModel:

KeyDescriptionDefault Value
clientConfigErrorMessageToast error message when client is providing invalid value to fansUnitedApiKey or fansUnitedClientId prop.There was a problem fetching client's configuration. Please check again your API key and client ID. For more information contact Fans United staff.
searchCompetitionsFilters search competitions autocomplete titleSearch competitions
competitionsSelectionPlaceholderFilters search competitions autocomplete placeholderSearch for competitions by their name
competitionsErrorMessageToast error message when there is an error while fetching competitionsThere was a problem with fetching competitions information
searchTeamsFilters search teams autocomplete titleSearch teams
teamsSelectionPlaceholderFilters search teams autocomplete placeholderSearch for teams by their name
searchTeamsErrorMessageToast error message when there is an error while fetching teamsThere was a problem searching for teams
fetchMatchesErrorMessageToast error message when there is an error while fetching matches based on filters providedThere was a problem while fetching matches. Please try again.
noMatchesFoundInfo message when there are no matches found by filters providedNo matches found
itemsPerPageFilters select titleItems per page
fromDateFilters datepicker titleFrom date
toDateFilters datepicker titleTo date
timeFormatTimeformat for displaying dates. Widgets uses dayjs as a date dependency.DD.MM.YYYY, HH:mm
fetchPotmResultsErrorMessageToast error message when there is an error while fetching player of the match results for particular gameThere was a problem with fetching "Player of The Match" results for match: matchName
noPotmStandingsAvailableInfo message when there are no standings availableNo Player of The Match standings available
totalVotesResults table column votes footerTotal votes
playerOfTheMatchStandingsHeader text for results tablePlayer of the match standings
playerTitle for players info columnPlayer
votesTitle for player votes columnVotes
winnerChip text for players with most votesWinner
minutesPlayedText label for player statistics info tooltipMinutes played
yellowCardsText label for player statistics info tooltipYellow cards
redCardsText label for player statistics info tooltipRed cards
goalsText label for player statistics info tooltipGoals
penaltyGoalsText label for player statistics info tooltipPenalty goals
penaltyCommittedText label for player statistics info tooltipPenalties commited
penaltyWonText label for player statistics info tooltipPenalties won
penaltyMissedText label for player statistics info tooltipPenalties missed
penaltyReceivedText label for player statistics info tooltipPenalties received
penaltySavedText label for player statistics info tooltipPenalties saved
ownGoalsText label for player statistics info tooltipOwn goals
assistsText label for player statistics info tooltipAssists
cleanSheetsText label for player statistics info tooltipClean sheets
shotsText label for player statistics info tooltipShots
shotsOnText label for player statistics info tooltipShots on target
shotsBlockedText label for player statistics info tooltipShots blocked
offsidesText label for player statistics info tooltipOffsides
foulsCommittedText label for player statistics info tooltipFouls committed
foulsWonText label for player statistics info tooltipFouls won
tacklesText label for player statistics info tooltipTackles
tacklesBlocksText label for player statistics info tooltipTackles blocked
tacklesInterceptionsText label for player statistics info tooltipTackles interceptions
concededGoalsText label for player statistics info tooltipConceded goals
caughtBallText label for player statistics info tooltipGaught balls
savesText label for player statistics info tooltipSaves
passesText label for player statistics info tooltipPasses
crossesText label for player statistics info tooltipCrosses
interceptionsText label for player statistics info tooltipInterceptions
keyPassesText label for player statistics info tooltipKey passes
passesAccuracyText label for player statistics info tooltipPasses accuracy
duelsText label for player statistics info tooltipDuels
duelsWonText label for player statistics info tooltipDuels won
dribblesAttemptsText label for player statistics info tooltipDribbles attempts
dribblesSuccessText label for player statistics info tooltipDribbles success
dribblesPastText label for player statistics info tooltipDribbles past
widgetEmbedCodeHeader text for widget embed code html cardWidget embed code
votingWindowWidget embed code voting window number input titleVoting window
votingWindowInfoWidget embed code voting window descriptionDetermines how many hours after the finish time will voting remain open.
copyToClipboardCopy to clipboard button tooltip textCopy to clipboard
divElementTextInfoWidget embed code info textThe generated embed code can be copied directly into your website's HTML. For comprehensive implementation details, visit our documentation:
warningTooltipInvalidMatchStatusMessageTooltip warning message when the match is with invalid status. The matchStatus will be replaced by match status informationThis match is currently with status: "matchStatus". The "Player of the Match" widget embed code will not work properly until the match status change to "not started" or "finished".
dataProviderLabel for data provider selectData provider
dataProviderDescriptionDescription for data provider selectSelect the data source for match identification.
dataProviderRemappingIdNotFoundMessageToast warning message when no football entity ID was found for the selected provider.No football entity ID was found for the selected provider.
dataProviderRemappingErrorMessageError toast message when there is an error while mapping football entity ID.There was a problem with mapping football entity ID. Please try again.
playersToShowLabel for players to show dropdown.Players to show
allError toast message when there is an error while mapping football entity ID.All
playersToShowDescriptionDescription for players to show dropdown.Choose which team’s players to include in the widget.
embedWidgetInfoInformation text about embedding widgetsEmbed widget information
urlCopiedToClipboardMessageToast success message when URL is copiedURL copied to clipboard
imageDeletedMessageToast message when image is deletedImage deleted
imageResetMessageToast message when image is resetThe initial size of the image has been restored
uploadingImageMessageToast message when image upload is successfulYou have successfully uploaded image
generateSignedInUrlErrorMessageToast error message for signed URL generation failureThere was a problem generating signed in URL to store the image in bucket. Please try again
uploadingImageErrorMessageToast error message for image upload failureThere was a problem with uploading image to bucket. Please try again
encryptingImageErrorMessageToast error message for image encryption failureThere was a problem with encrypting image before uploading it to bucket. Please try again
searchSportal365ImagesErrorMessageToast error message for Sportal365 image search failureThere was a problem with searching images from Sportal 365 API. Please try again
clearImageButton text for clearing imageClear image
viewImageButton text for viewing imageView image
cropImageButton text for cropping imageCrop image
uploadImageButton text for uploading imageUpload image
copyUrlButton text for copying URLCopy URL
sportal365ImagesLabel for Sportal365 images sectionSportal365 images
hideFiltersButton text for hiding filtersHide filters
showFiltersButton text for showing filtersShow filters
searchButton text for search actionSearch
aspectRatioLabel for aspect ratio settingAspect ratio
cropButton text for crop actionCrop
resetButton text for reset actionReset
getPlayersErrorMessageToast error message when fetching players failsThere was a problem fetching players. Please try again.
specificPlayersLabel for specific players selectionSpecific players
specificPlayersDescriptionDescription for specific players selectionSelect specific players to display in the widget. If no players are selected, all players from the chosen team(s) will be available for voting.
brandingAreaLabel for branding area sectionBranding area
imageLabel for image fieldImage
urlLabel for URL fieldURL
brandingUrlTooltipTooltip text for branding URL fieldURL that the branding area will link to when clicked. Opens in a new tab.
authRequirementLabel for auth requirement fieldAuth requirement
authRequirementDescriptionDescription for auth requirement fieldDetermines who can participate in voting. "None" allows anonymous users, while "Registered" requires user authentication.
signInLabelLabel for sign-in label fieldLabel
signInLabelDescriptionDescription for sign-in label fieldCustom text displayed on the sign-in button. If empty, defaults to "Sign in to vote".
authenticationHandlerLabel for authentication handler fieldAuthentication handler
authenticationHandlerDescriptionDescription for authentication handler fieldJavaScript function code that executes when users click the sign-in button. To evaluate the function, provide only the function name. Example: showLoginModal() or window.openAuth(). The function is required otherwise the sign-in button will just log dummy message in the console.
actionTitle for action column in results tableAction
showStatisticsButton text for showing player statisticsShow statistics
closeButton text for closing modals/dialogsClose