You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AudioSettingsEntry.js 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // @flow
  2. import React from 'react';
  3. import { Icon, IconCheck, IconExclamationSolid } from '../../../../base/icons';
  4. /**
  5. * The type of the React {@code Component} props of {@link AudioSettingsEntry}.
  6. */
  7. export type Props = {
  8. /**
  9. * The text for this component.
  10. */
  11. children: React$Node,
  12. /**
  13. * Flag indicating an error.
  14. */
  15. hasError?: boolean,
  16. /**
  17. * Flag indicating the selection state.
  18. */
  19. isSelected: boolean,
  20. };
  21. /**
  22. * React {@code Component} representing an entry for the audio settings.
  23. *
  24. * @returns { ReactElement}
  25. */
  26. export default function AudioSettingsEntry({ children, hasError, isSelected }: Props) {
  27. const className = `audio-preview-entry ${isSelected
  28. ? 'audio-preview-entry--selected' : ''}`;
  29. return (
  30. <div className = { className }>
  31. {isSelected && (
  32. <Icon
  33. className = 'audio-preview-icon audio-preview-icon--check'
  34. color = '#1C2025'
  35. size = { 14 }
  36. src = { IconCheck } />
  37. )}
  38. <span className = 'audio-preview-entry-text'>{children}</span>
  39. {hasError && <Icon
  40. className = 'audio-preview-icon audio-preview-icon--exclamation'
  41. size = { 16 }
  42. src = { IconExclamationSolid } />}
  43. </div>
  44. );
  45. }