2021-03-31 06:45:21 +02:00
|
|
|
import * as React from "react";
|
|
|
|
import { numeralWrapper } from "../../ui/numeralFormat";
|
2021-10-01 19:08:37 +02:00
|
|
|
import { Theme } from "@mui/material/styles";
|
|
|
|
import makeStyles from "@mui/styles/makeStyles";
|
|
|
|
import createStyles from "@mui/styles/createStyles";
|
2021-03-31 06:45:21 +02:00
|
|
|
|
2021-10-01 19:08:37 +02:00
|
|
|
const useStyles = makeStyles((theme: Theme) =>
|
|
|
|
createStyles({
|
|
|
|
reputation: {
|
|
|
|
color: theme.colors.rep,
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
|
|
|
|
export function Reputation({ reputation }: { reputation: number | string }): React.ReactElement {
|
|
|
|
const classes = useStyles();
|
2021-09-05 01:09:30 +02:00
|
|
|
return (
|
2021-10-01 19:08:37 +02:00
|
|
|
<span className={classes.reputation}>
|
2021-10-01 21:19:37 +02:00
|
|
|
{typeof reputation === "number" ? numeralWrapper.formatReputation(reputation) : reputation}
|
2021-09-05 01:09:30 +02:00
|
|
|
</span>
|
|
|
|
);
|
|
|
|
}
|