mirror of
https://github.com/outline/outline.git
synced 2026-11-22 05:51:43 +03:00
* Upgrade Prettier to v3.6.2 and eslint-plugin-prettier to v5.5.1 - Upgraded prettier from ^2.8.8 to ^3.6.2 (latest version) - Upgraded eslint-plugin-prettier from ^4.2.1 to ^5.5.1 for compatibility - Applied automatic formatting changes from new Prettier version - All existing ESLint and Prettier configurations remain compatible * Applied automatic fixes * Trigger CI --------- Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com> Co-authored-by: Tom Moor <tom@getoutline.com>
95 lines
2.0 KiB
TypeScript
95 lines
2.0 KiB
TypeScript
import { useTranslation } from "react-i18next";
|
|
import { Link } from "react-router-dom";
|
|
import styled from "styled-components";
|
|
import { s, ellipsis } from "@shared/styles";
|
|
import { ConfigItem } from "~/hooks/useSettingsConfig";
|
|
import Button from "../../../components/Button";
|
|
import Flex from "../../../components/Flex";
|
|
import Text from "../../../components/Text";
|
|
|
|
type Props = {
|
|
integration: ConfigItem;
|
|
isConnected?: boolean;
|
|
};
|
|
|
|
function IntegrationCard({ integration, isConnected }: Props) {
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<Card as={Link} to={integration.path}>
|
|
<Flex align="center" gap={8}>
|
|
<integration.icon size={48} />
|
|
<Flex auto column>
|
|
<Name>{integration.name}</Name>
|
|
{isConnected && <Status>{t("Connected")}</Status>}
|
|
</Flex>
|
|
<Button as="span" neutral>
|
|
{isConnected ? t("Configure") : t("Connect")}
|
|
</Button>
|
|
</Flex>
|
|
|
|
<Description>{integration.description}</Description>
|
|
</Card>
|
|
);
|
|
}
|
|
|
|
export default IntegrationCard;
|
|
|
|
const Card = styled.div`
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex-grow: 1;
|
|
padding: 20px;
|
|
width: 300px;
|
|
background: ${s("background")};
|
|
border: 1px solid ${s("inputBorder")};
|
|
color: ${s("text")};
|
|
border-radius: 8px;
|
|
transition: box-shadow 200ms ease;
|
|
cursor: var(--pointer);
|
|
|
|
&:hover {
|
|
box-shadow:
|
|
rgba(0, 0, 0, 0.08) 0px 2px 4px,
|
|
rgba(0, 0, 0, 0.06) 0px 4px 8px;
|
|
}
|
|
`;
|
|
|
|
const Name = styled(Text)`
|
|
margin: 0;
|
|
font-size: 16px;
|
|
font-weight: 600;
|
|
color: ${s("text")};
|
|
${ellipsis()}
|
|
`;
|
|
|
|
const Description = styled(Text)`
|
|
margin: 8px 0 0;
|
|
font-size: 15px;
|
|
max-width: 100%;
|
|
color: ${s("textTertiary")};
|
|
`;
|
|
|
|
const Status = styled(Text).attrs({
|
|
type: "secondary",
|
|
size: "small",
|
|
as: "span",
|
|
})`
|
|
display: inline-flex;
|
|
align-items: center;
|
|
|
|
&::after {
|
|
content: "";
|
|
display: inline-block;
|
|
width: 17px;
|
|
height: 17px;
|
|
|
|
background: radial-gradient(
|
|
circle at center,
|
|
${s("accent")} 0 33%,
|
|
transparent 33%
|
|
);
|
|
border-radius: 50%;
|
|
}
|
|
`;
|