♻️ (builder) Change to features-centric folder structure
This commit is contained in:
committed by
Baptiste Arnaud
parent
3686465a85
commit
643571fe7d
47
apps/builder/src/components/UnlockPlanAlertInfo.tsx
Normal file
47
apps/builder/src/components/UnlockPlanAlertInfo.tsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import {
|
||||
Alert,
|
||||
AlertIcon,
|
||||
AlertProps,
|
||||
Button,
|
||||
HStack,
|
||||
Text,
|
||||
useDisclosure,
|
||||
} from '@chakra-ui/react'
|
||||
import React from 'react'
|
||||
import { ChangePlanModal, LimitReached } from '@/features/billing'
|
||||
|
||||
export const UnlockPlanAlertInfo = ({
|
||||
contentLabel,
|
||||
buttonLabel = 'More info',
|
||||
type,
|
||||
...props
|
||||
}: {
|
||||
contentLabel: React.ReactNode
|
||||
buttonLabel?: string
|
||||
type?: LimitReached
|
||||
} & AlertProps) => {
|
||||
const { isOpen, onOpen, onClose } = useDisclosure()
|
||||
return (
|
||||
<Alert
|
||||
status="info"
|
||||
rounded="md"
|
||||
justifyContent="space-between"
|
||||
flexShrink={0}
|
||||
{...props}
|
||||
>
|
||||
<HStack>
|
||||
<AlertIcon />
|
||||
<Text>{contentLabel}</Text>
|
||||
</HStack>
|
||||
<Button
|
||||
colorScheme={props.status === 'warning' ? 'orange' : 'blue'}
|
||||
onClick={onOpen}
|
||||
flexShrink={0}
|
||||
ml="2"
|
||||
>
|
||||
{buttonLabel}
|
||||
</Button>
|
||||
<ChangePlanModal isOpen={isOpen} onClose={onClose} type={type} />
|
||||
</Alert>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user