1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/frontend/src/component/integrations/IntegrationHowToSection/IntegrationHowToSection.tsx
Christopher Kolstad 53354224fc
chore: Bump biome and configure husky (#6589)
Upgrades biome to 1.6.1, and updates husky pre-commit hook.

Most changes here are making type imports explicit.
2024-03-18 13:58:05 +01:00

41 lines
1.3 KiB
TypeScript

import type { AddonTypeSchema } from 'openapi';
import type { VFC } from 'react';
import { StyledRaisedSection } from '../IntegrationForm/IntegrationForm.styles';
import { Typography, styled } from '@mui/material';
import { IntegrationIcon } from '../IntegrationList/IntegrationIcon/IntegrationIcon';
import { Markdown } from 'component/common/Markdown/Markdown';
const StyledHowDoesItWorkSection = styled(StyledRaisedSection)(({ theme }) => ({
fontSize: theme.fontSizes.smallBody,
gap: theme.spacing(1.5),
}));
interface IIntegrationHowToSectionProps {
provider?: Pick<AddonTypeSchema, 'howTo' | 'name'>;
title?: string;
}
export const IntegrationHowToSection: VFC<IIntegrationHowToSectionProps> = ({
provider,
title = 'How does it work?',
}) => {
if (!provider?.name || !provider?.howTo) return null;
return (
<StyledHowDoesItWorkSection>
<Typography
variant='h4'
component='h3'
sx={(theme) => ({
display: 'flex',
alignItems: 'center',
marginBottom: theme.spacing(1),
})}
>
<IntegrationIcon name={provider.name} /> {title}
</Typography>
<Markdown>{provider!.howTo || ''}</Markdown>
</StyledHowDoesItWorkSection>
);
};