mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 09:23:51 +00:00
committed by
GitHub
parent
f561e52bb5
commit
0f5c47bc82
@@ -1,7 +1,7 @@
|
||||
import { KeyboardEvent, useState } from 'react';
|
||||
import { Input, Modal, ModalBody, ModalContent, ModalFooter, ModalOverlay } from '@chakra-ui/react';
|
||||
import { useDebouncedCallback } from '@mantine/hooks';
|
||||
import { isOntimeEvent, SupportedEvent } from 'ontime-types';
|
||||
import { SupportedEvent } from 'ontime-types';
|
||||
|
||||
import { useEventSelection } from '../../rundown/useEventSelection';
|
||||
|
||||
@@ -65,14 +65,15 @@ export default function Finder(props: FinderProps) {
|
||||
{error && <li className={style.error}>{error}</li>}
|
||||
{results.length === 0 && <li className={style.empty}>No results</li>}
|
||||
{results.length > 0 &&
|
||||
results.map((event, index) => {
|
||||
results.map((entry, index) => {
|
||||
const isSelected = selected === index;
|
||||
const displayIndex = event.type === SupportedEvent.Block ? '-' : event.index;
|
||||
const colour = event.type === SupportedEvent.Event ? event.colour : '';
|
||||
const displayIndex = entry.type === SupportedEvent.Event ? entry.eventIndex : '-';
|
||||
const displayCue = entry.type === SupportedEvent.Event ? entry.cue : '';
|
||||
const colour = entry.type === SupportedEvent.Event ? entry.colour : '';
|
||||
|
||||
return (
|
||||
<li
|
||||
key={event.id}
|
||||
key={entry.id}
|
||||
className={style.entry}
|
||||
data-selected={isSelected}
|
||||
data-index={index}
|
||||
@@ -82,8 +83,8 @@ export default function Finder(props: FinderProps) {
|
||||
<div className={style.index} style={{ '--color': colour }}>
|
||||
{displayIndex}
|
||||
</div>
|
||||
{isOntimeEvent(event) && <div className={style.cue}>{event.cue}</div>}
|
||||
<div className={style.title}>{event.title}</div>
|
||||
<div className={style.cue}>{displayCue}</div>
|
||||
<div className={style.title}>{entry.title}</div>
|
||||
</div>
|
||||
{isSelected && <span>Go ⏎</span>}
|
||||
</li>
|
||||
|
||||
@@ -39,8 +39,6 @@ export const TranslationContext = createContext<TranslationContextValue>({
|
||||
export const TranslationProvider = ({ children }: PropsWithChildren) => {
|
||||
const { data } = useSettings();
|
||||
|
||||
console.log('....', data.language)
|
||||
|
||||
const getLocalizedString = useCallback(
|
||||
(key: keyof typeof langEn, lang = data?.language || 'en'): string => {
|
||||
if (lang in translationsList) {
|
||||
|
||||
Reference in New Issue
Block a user