mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
Add favorite/rating table columns
This commit is contained in:
parent
d1dfbaedaa
commit
ab031820f6
12 changed files with 158 additions and 29 deletions
|
|
@ -0,0 +1,17 @@
|
|||
import type { ICellRendererParams } from '@ag-grid-community/core';
|
||||
import { RiHeartFill, RiHeartLine } from 'react-icons/ri';
|
||||
import { Button } from '/@/renderer/components/button';
|
||||
import { CellContainer } from '/@/renderer/components/virtual-table/cells/generic-cell';
|
||||
|
||||
export const FavoriteCell = ({ value }: ICellRendererParams) => {
|
||||
return (
|
||||
<CellContainer position="center">
|
||||
<Button
|
||||
compact
|
||||
variant="subtle"
|
||||
>
|
||||
{!value ? <RiHeartLine /> : <RiHeartFill />}
|
||||
</Button>
|
||||
</CellContainer>
|
||||
);
|
||||
};
|
||||
14
src/renderer/components/virtual-table/cells/rating-cell.tsx
Normal file
14
src/renderer/components/virtual-table/cells/rating-cell.tsx
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import type { ICellRendererParams } from '@ag-grid-community/core';
|
||||
import { Rating } from '/@/renderer/components/rating';
|
||||
import { CellContainer } from '/@/renderer/components/virtual-table/cells/generic-cell';
|
||||
|
||||
export const RatingCell = ({ value }: ICellRendererParams) => {
|
||||
return (
|
||||
<CellContainer position="center">
|
||||
<Rating
|
||||
size="xs"
|
||||
value={value}
|
||||
/>
|
||||
</CellContainer>
|
||||
);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue