jiti-meet/react/features/subtitles/components/LanguageList.tsx

51 lines
1.1 KiB
TypeScript
Raw Normal View History

import React from 'react';
2022-09-13 07:36:00 +00:00
import { makeStyles } from 'tss-react/mui';
import LanguageListItem from './LanguageListItem';
interface ILanguageListProps {
items: Array<ILanguageItem>;
onLanguageSelected: (lang: string) => void;
selectedLanguage: string;
}
2022-09-13 07:36:00 +00:00
const useStyles = makeStyles()(() => {
return {
itemsContainer: {
display: 'flex',
flexFlow: 'column'
}
};
});
interface ILanguageItem {
id: string;
lang: string;
selected: boolean;
}
/**
* Component that renders the security options dialog.
*
* @returns {React$Element<any>}
*/
const LanguageList = ({
items,
onLanguageSelected
}: ILanguageListProps) => {
2022-09-13 07:36:00 +00:00
const { classes: styles } = useStyles();
const listItems = items.map(item => (<LanguageListItem
key = { item.id }
lang = { item.lang }
onLanguageSelected = { onLanguageSelected }
selected = { item.selected } />));
return (
<div className = { styles.itemsContainer }>{listItems}</div>
);
};
export default LanguageList;