mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
* Update localforage, remove query-string * Update fontawesome and flag-icons * Update formatjs * Update axios and videojs * Update apollo client and graphql * Update bootstrap and react * Update polyfills * Update vite * Update ESLint * Update stylelint * Update configs * Rebuild yarn.lock
29 lines
574 B
TypeScript
29 lines
574 B
TypeScript
import React from "react";
|
|
import { useIntl } from "react-intl";
|
|
import { getCountryByISO } from "src/utils";
|
|
|
|
interface ICountryFlag {
|
|
country?: string | null;
|
|
className?: string;
|
|
}
|
|
|
|
const CountryFlag: React.FC<ICountryFlag> = ({
|
|
className,
|
|
country: isoCountry,
|
|
}) => {
|
|
const { locale } = useIntl();
|
|
|
|
const country = getCountryByISO(isoCountry, locale);
|
|
|
|
if (!isoCountry || !country) return <></>;
|
|
|
|
return (
|
|
<span
|
|
className={`${className ?? ""} fi fi-${isoCountry.toLowerCase()}`}
|
|
title={country}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default CountryFlag;
|