Skip to content

Commit

Permalink
Updates to inline feedback component
Browse files Browse the repository at this point in the history
  • Loading branch information
sophialittlejohn committed Jul 25, 2024
1 parent 28d27af commit 0b26f90
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fabric/src/components/InlineFeedback/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ const icons = {
critical: IconInfoFailed,
}

const capitalizeFirstLetter = (status: string) => status.charAt(0).toUpperCase() + status.slice(1)

export function InlineFeedback({ status = 'default', children }: InlineFeedbackProps) {
return (
<Text variant="body3">
<Shelf alignItems="baseline" gap="4px">
<StyledIconWrapper minWidth="iconSmall" height="iconSmall" flex="0 0 auto">
<StyledIcon as={icons[status]} size="iconSmall" />
<StyledIcon as={icons[status]} size="iconSmall" color={`status${capitalizeFirstLetter(status)}`} />
</StyledIconWrapper>
<Text>{children}</Text>
</Shelf>
Expand Down

0 comments on commit 0b26f90

Please sign in to comment.