mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
24 lines
510 B
TypeScript
24 lines
510 B
TypeScript
import React from "react";
|
|
import { getISOCountry } from "src/utils";
|
|
|
|
interface ICountryFlag {
|
|
country?: string | null;
|
|
className?: string;
|
|
}
|
|
|
|
const CountryFlag: React.FC<ICountryFlag> = ({ className, country }) => {
|
|
const ISOCountry = getISOCountry(country);
|
|
if (!ISOCountry?.code) return <></>;
|
|
|
|
return (
|
|
<span
|
|
className={`${
|
|
className ?? ""
|
|
} flag-icon flag-icon-${ISOCountry.code.toLowerCase()}`}
|
|
title={ISOCountry.name}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default CountryFlag;
|