fa0933b292
This PR was created by [GitStart](https://gitstart.com/) to address the requirements from this ticket: [TWNTY-7533](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7533). --- Description \ \ Move Section component from twenty-front to twenty-ui and update imports\ \ \ Fixes twentyhq/private-issues#85 Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com>
66 lines
1.8 KiB
TypeScript
66 lines
1.8 KiB
TypeScript
import styled from '@emotion/styled';
|
|
import { Link } from 'react-router-dom';
|
|
import { H2Title, Section } from 'twenty-ui';
|
|
|
|
import { SettingsIntegrationComponent } from '@/settings/integrations/components/SettingsIntegrationComponent';
|
|
import { SettingsIntegrationCategory } from '@/settings/integrations/types/SettingsIntegrationCategory';
|
|
|
|
interface SettingsIntegrationGroupProps {
|
|
integrationGroup: SettingsIntegrationCategory;
|
|
}
|
|
|
|
const StyledIntegrationGroupHeader = styled.div`
|
|
align-items: start;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
`;
|
|
|
|
const StyledGroupLink = styled(Link)`
|
|
align-items: start;
|
|
display: flex;
|
|
flex-direction: row;
|
|
font-size: ${({ theme }) => theme.font.size.md};
|
|
gap: ${({ theme }) => theme.spacing(1)};
|
|
cursor: pointer;
|
|
text-decoration: none;
|
|
color: ${({ theme }) => theme.font.color.primary};
|
|
`;
|
|
|
|
const StyledIntegrationsSection = styled.div`
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: ${({ theme }) => theme.spacing(4)};
|
|
`;
|
|
|
|
export const SettingsIntegrationGroup = ({
|
|
integrationGroup,
|
|
}: SettingsIntegrationGroupProps) => (
|
|
<Section>
|
|
<StyledIntegrationGroupHeader>
|
|
<H2Title title={integrationGroup.title} />
|
|
{integrationGroup.hyperlink && (
|
|
<StyledGroupLink
|
|
target={'_blank'}
|
|
to={integrationGroup.hyperlink ?? ''}
|
|
>
|
|
<div>{integrationGroup.hyperlinkText}</div>
|
|
<div>→</div>
|
|
</StyledGroupLink>
|
|
)}
|
|
</StyledIntegrationGroupHeader>
|
|
<StyledIntegrationsSection>
|
|
{integrationGroup.integrations.map((integration) => (
|
|
<SettingsIntegrationComponent
|
|
key={[
|
|
integrationGroup.key,
|
|
integration.from.key,
|
|
integration.to?.key,
|
|
].join('-')}
|
|
integration={integration}
|
|
/>
|
|
))}
|
|
</StyledIntegrationsSection>
|
|
</Section>
|
|
);
|