implemented identity, updated session, added 'workings' list
added paginated querying, added 'common'
This commit is contained in:
parent
027deba422
commit
6ada519e06
36 changed files with 1422 additions and 279 deletions
28
app/client/components/WorkingRatingBadge.tsx
Normal file
28
app/client/components/WorkingRatingBadge.tsx
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import { BadgeProps, Text } from '@chakra-ui/react';
|
||||
import { IconBadge } from './WorkingListCard';
|
||||
|
||||
interface WorkingRatingParams {
|
||||
rating: string;
|
||||
color: BadgeProps['backgroundColor'];
|
||||
iconClass: string;
|
||||
}
|
||||
|
||||
export function WorkingRatingBadge({ ratingTotal }: { ratingTotal: number }) {
|
||||
const ratingParams: WorkingRatingParams =
|
||||
ratingTotal >= 0
|
||||
? {
|
||||
rating: ratingTotal.toString(),
|
||||
color: 'green.500',
|
||||
iconClass: 'nf nf-fa-angle_up'
|
||||
}
|
||||
: {
|
||||
rating: ratingTotal.toString().slice(1),
|
||||
color: 'red.500',
|
||||
iconClass: 'nf nf-fa-angle_down'
|
||||
};
|
||||
return (
|
||||
<IconBadge backgroundColor={ratingParams.color} iconClass={ratingParams.iconClass}>
|
||||
<Text>{ratingParams.rating}</Text>
|
||||
</IconBadge>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue