2023-09-12 14:25:38 +02:00
|
|
|
import { AddonTypeSchema } from 'openapi';
|
|
|
|
import { VFC } from 'react';
|
|
|
|
import { StyledRaisedSection } from '../IntegrationForm/IntegrationForm.styles';
|
2023-09-15 15:50:59 +02:00
|
|
|
import { Typography, styled } from '@mui/material';
|
2023-09-12 14:25:38 +02:00
|
|
|
import { IntegrationIcon } from '../IntegrationList/IntegrationIcon/IntegrationIcon';
|
2024-01-05 09:18:34 +01:00
|
|
|
import { Markdown } from 'component/common/Markdown/Markdown';
|
2023-09-12 14:25:38 +02:00
|
|
|
|
2024-01-12 10:25:59 +01:00
|
|
|
const StyledHowDoesItWorkSection = styled(StyledRaisedSection)(({ theme }) => ({
|
|
|
|
fontSize: theme.fontSizes.smallBody,
|
|
|
|
gap: theme.spacing(1.5),
|
|
|
|
}));
|
2023-09-15 15:50:59 +02:00
|
|
|
|
2023-09-12 14:25:38 +02:00
|
|
|
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 (
|
2023-09-15 15:50:59 +02:00
|
|
|
<StyledHowDoesItWorkSection>
|
2023-09-12 14:25:38 +02:00
|
|
|
<Typography
|
2023-10-02 14:25:46 +02:00
|
|
|
variant='h4'
|
|
|
|
component='h3'
|
|
|
|
sx={(theme) => ({
|
2023-09-12 14:25:38 +02:00
|
|
|
display: 'flex',
|
|
|
|
alignItems: 'center',
|
|
|
|
marginBottom: theme.spacing(1),
|
|
|
|
})}
|
|
|
|
>
|
|
|
|
<IntegrationIcon name={provider.name} /> {title}
|
|
|
|
</Typography>
|
2024-01-05 09:18:34 +01:00
|
|
|
<Markdown>{provider!.howTo || ''}</Markdown>
|
2023-09-15 15:50:59 +02:00
|
|
|
</StyledHowDoesItWorkSection>
|
2023-09-12 14:25:38 +02:00
|
|
|
);
|
|
|
|
};
|