(props: EntryPointDialogProps)
| 54 | export const ENTRY_SUBLINE = messages.entry.subline; |
| 55 | |
| 56 | export default function EntryPointDialog(props: EntryPointDialogProps): JSX.Element { |
| 57 | return ( |
| 58 | <div |
| 59 | className="atlas-entry" |
| 60 | data-testid="atlas-entry" |
| 61 | role="dialog" |
| 62 | aria-label={ENTRY_TITLE} |
| 63 | onKeyDown={props.onKeyDown} |
| 64 | > |
| 65 | <div className="atlas-entry-inner"> |
| 66 | <header className="atlas-entry-head"> |
| 67 | <h2 className="atlas-entry-title">{ENTRY_TITLE}</h2> |
| 68 | <button |
| 69 | type="button" |
| 70 | className="atlas-entry-close" |
| 71 | data-testid="atlas-entry-close" |
| 72 | aria-label={messages.entry.closeLabel} |
| 73 | onClick={props.onClose} |
| 74 | > |
| 75 | {messages.entry.close} |
| 76 | </button> |
| 77 | </header> |
| 78 | <p className="atlas-entry-subline">{ENTRY_SUBLINE}</p> |
| 79 | |
| 80 | <div className="atlas-entry-search"> |
| 81 | <span className="atlas-entry-prompt">{'>'}</span> |
| 82 | <input |
| 83 | className="atlas-entry-input" |
| 84 | data-testid="atlas-entry-input" |
| 85 | aria-label={messages.entry.searchLabel} |
| 86 | placeholder={ENTRY_SEARCH_PLACEHOLDER} |
| 87 | value={props.query} |
| 88 | autoComplete="off" |
| 89 | onChange={(event) => props.onQueryChange(event.target.value)} |
| 90 | /> |
| 91 | <span className="atlas-entry-status" data-status={props.status}> |
| 92 | {props.status === 'searching' ? messages.entry.searching : ''} |
| 93 | </span> |
| 94 | </div> |
| 95 | |
| 96 | {props.hits.length > 0 && ( |
| 97 | <div className="atlas-entry-list" data-testid="atlas-entry-hits" role="listbox"> |
| 98 | {props.hits.map((row, index) => ( |
| 99 | <button |
| 100 | key={row.key} |
| 101 | type="button" |
| 102 | className="atlas-entry-row" |
| 103 | data-testid="atlas-entry-hit" |
| 104 | data-name={row.name} |
| 105 | role="option" |
| 106 | aria-selected="false" |
| 107 | onMouseDown={(event) => { |
| 108 | event.preventDefault(); |
| 109 | props.onChooseHit(index); |
| 110 | }} |
| 111 | onKeyDown={(event) => { |
| 112 | if (event.key === 'Enter' || event.key === ' ') { |
| 113 | event.preventDefault(); |
nothing calls this directly
no outgoing calls
no test coverage detected