Files
outline/app/components/PluginIcon.tsx
Tom Moor 21a1257d06 chore: Move remaining auth methods to plugins (#4900)
* Move Google, Email, and Azure to plugins

* Move OIDC provider, remove old loading code

* Move AuthLogo to plugin

* AuthLogo -> PluginIcon

* Lazy load plugin settings
2023-02-19 19:52:08 -08:00

36 lines
625 B
TypeScript

import * as React from "react";
import styled from "styled-components";
import PluginLoader from "~/utils/PluginLoader";
type Props = {
id: string;
size?: number;
color?: string;
};
function PluginIcon({ id, color, size = 24 }: Props) {
const plugin = PluginLoader.plugins[id];
const Icon = plugin?.icon;
if (Icon) {
return (
<Wrapper>
<Icon size={size} fill={color} />
</Wrapper>
);
}
return null;
}
const Wrapper = styled.div`
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 24px;
height: 24px;
`;
export default PluginIcon;