1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-28 17:55:15 +02:00
unleash.unleash/frontend/src/component/integrations/IntegrationHowToSection/IntegrationHowToSection.tsx
Nuno Góis 4167a60588
feat: biome lint frontend (#4903)
Follows up on https://github.com/Unleash/unleash/pull/4853 to add Biome
to the frontend as well.


![image](https://github.com/Unleash/unleash/assets/14320932/1906faf1-fc29-4172-a4d4-b2716d72cd65)

Added a few `biome-ignore` to speed up the process but we may want to
check and fix them in the future.
2023-10-02 13:25:46 +01:00

41 lines
1.3 KiB
TypeScript

import { AddonTypeSchema } from 'openapi';
import { VFC } from 'react';
import { StyledRaisedSection } from '../IntegrationForm/IntegrationForm.styles';
import { Typography, styled } from '@mui/material';
import { IntegrationIcon } from '../IntegrationList/IntegrationIcon/IntegrationIcon';
import ReactMarkdown from 'react-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>
<ReactMarkdown>{provider!.howTo || ''}</ReactMarkdown>
</StyledHowDoesItWorkSection>
);
};