TeaWeb/shared/js/ui/react-elements/CountryCode.tsx

14 lines
591 B
TypeScript
Raw Permalink Normal View History

2021-03-23 12:42:32 +00:00
import * as React from "react";
import {joinClassList, useTr} from "tc-shared/ui/react-elements/Helper";
2021-04-27 11:30:33 +00:00
import {getCountryFlag, getCountryName} from "../../i18n/CountryFlag";
2021-03-23 12:42:32 +00:00
const cssStyle = require("./CountryIcon.scss");
export const CountryCode = (props: { alphaCode: string, className?: string }) => {
return (
<div className={joinClassList(cssStyle.countryContainer, props.className)}>
<div className={"flag_em " + getCountryFlag(props.alphaCode) + " " + cssStyle.icon} />
{getCountryName(props.alphaCode, useTr("Global"))}
</div>
)
};