-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
JP Angelle
committed
Sep 28, 2023
1 parent
9130bd1
commit fb56b73
Showing
3 changed files
with
66 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { Loan, TinlakeLoan } from '@centrifuge/centrifuge-js' | ||
import { Box, Shelf, Stack, Text } from '@centrifuge/fabric' | ||
import * as React from 'react' | ||
import { useTheme } from 'styled-components' | ||
import LoanLabel from './LoanLabel' | ||
|
||
type Props = { | ||
data?: { | ||
label: React.ReactNode | ||
value: React.ReactNode | ||
}[] | ||
children?: React.ReactNode | ||
loan: Loan | TinlakeLoan | ||
} | ||
|
||
export const AssetSummary: React.FC<Props> = ({ data, children, loan }) => { | ||
const theme = useTheme() | ||
return ( | ||
<Stack bg={theme.colors.backgroundSecondary} pl={3}> | ||
<Box paddingTop={3}> | ||
<Shelf gap="2"> | ||
<Text variant="heading2">Details</Text> | ||
<LoanLabel loan={loan} /> | ||
</Shelf> | ||
</Box> | ||
<Shelf | ||
gap="6" | ||
py="3" | ||
style={{ | ||
boxShadow: `0 1px 0 ${theme.colors.borderSecondary}`, | ||
}} | ||
> | ||
{data?.map(({ label, value }, index) => ( | ||
<Stack gap="4px" key={`${value}-${label}-${index}`}> | ||
<Text variant="body3" style={{ fontWeight: 500 }}> | ||
{label} | ||
</Text> | ||
<Text variant="body2">{value}</Text> | ||
</Stack> | ||
))} | ||
{children} | ||
</Shelf> | ||
</Stack> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters