mirror of
https://github.com/RoboSats/robosats.git
synced 2025-07-26 19:23:33 +00:00

* Add SVG icons for map pins * Add federation basis and new coordinator form (#793) * Add new coordinator entry issue form * Add Federation basis * Fix eslint errors from F2F and fix languages * Redo eslint @typescript-eslint/strict-boolean-expressions * Robot Page working * Contexts Working * Garage Working * CurrentOrder working * Federation model working --------- Co-authored-by: Reckless_Satoshi <reckless.satoshi@protonmail.com> Co-authored-by: Reckless_Satoshi <90936742+Reckless-Satoshi@users.noreply.github.com>
47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import React from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { Typography, useTheme } from '@mui/material';
|
|
import { Lock, LockOpen, Balance } from '@mui/icons-material';
|
|
|
|
interface BondStatusProps {
|
|
status: 'locked' | 'settled' | 'unlocked' | 'hide';
|
|
isMaker: boolean;
|
|
}
|
|
|
|
const BondStatus = ({ status, isMaker }: BondStatusProps): JSX.Element => {
|
|
const { t } = useTranslation();
|
|
const theme = useTheme();
|
|
|
|
let Icon = Lock;
|
|
let color = 'primary';
|
|
if (status === 'unlocked') {
|
|
Icon = LockOpen;
|
|
color = theme.palette.mode === 'dark' ? 'lightgreen' : 'green';
|
|
} else if (status === 'settled') {
|
|
Icon = Balance;
|
|
color = theme.palette.mode === 'dark' ? 'lightred' : 'red';
|
|
}
|
|
|
|
if (status === 'hide') {
|
|
return <></>;
|
|
} else {
|
|
return (
|
|
<Typography color={color} variant='subtitle1' align='center'>
|
|
<div
|
|
style={{
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
flexWrap: 'wrap',
|
|
}}
|
|
>
|
|
<Icon sx={{ height: '0.9em', width: '0.9em' }} />
|
|
{t(`Your ${isMaker ? 'maker' : 'taker'} bond is ${status}`)}
|
|
</div>
|
|
</Typography>
|
|
);
|
|
}
|
|
};
|
|
|
|
export default BondStatus;
|