-
Notifications
You must be signed in to change notification settings - Fork 35
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
Showing
4 changed files
with
171 additions
and
14 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
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,49 @@ | ||
import { Button, Icon } from '@equinor/eds-core-react' | ||
import { ReactNode } from 'react' | ||
import styled from 'styled-components' | ||
import { Icons } from 'utils/icons' | ||
|
||
const StyledListItem = styled.div` | ||
display: flex; | ||
width: 300px; | ||
height: auto; | ||
padding: 3px 10px 2px 10px; | ||
justify-content: space-between; | ||
align-items: center; | ||
` | ||
const Horizontal = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
align-items: center; | ||
` | ||
const Center = styled.div` | ||
align-items: center; | ||
` | ||
|
||
export enum AlertCategory { | ||
ERROR, | ||
WARNING, | ||
INFO, | ||
} | ||
|
||
interface AlertProps { | ||
children: ReactNode | ||
dismissAlert: () => void | ||
alertCategory: AlertCategory | ||
} | ||
|
||
export const AlertListItem = ({ children, dismissAlert, alertCategory }: AlertProps) => { | ||
return ( | ||
<> | ||
<StyledListItem> | ||
<Horizontal> | ||
<Center>{children}</Center> | ||
</Horizontal> | ||
<Button variant="ghost_icon" onClick={dismissAlert}> | ||
<Icon name={Icons.Clear} size={24}></Icon> | ||
</Button> | ||
</StyledListItem> | ||
</> | ||
) | ||
} |
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