saleor-apps-redis_apl/apps/taxes/src/modules/ui/provider-label.tsx
Adrian Pilarczyk be761b251e
chore: split credentials and settings (#886)
* feat:  grey out disabled links

* chore: 🚚 move fields to new avatax settings fragment

* build: 👷 add changeset

* refactor: 🚚 move companyCode to credentials

* refactor: ♻️ make helper texts more accurate

* refactor: 🚚 Avatax -> AvaTax
2023-08-21 10:28:43 +02:00

38 lines
944 B
TypeScript

import { Box, Text } from "@saleor/macaw-ui/next";
import Image from "next/image";
import { ProviderName } from "../provider-connections/provider-connections";
import { TaxJarIcon, AvataxIcon, StripeTaxIcon } from "../../assets";
type ProviderNameWithStripeTax = ProviderName | "stripeTax";
const providerConfig = {
taxjar: {
label: "TaxJar",
icon: TaxJarIcon,
},
avatax: {
label: "AvaTax",
icon: AvataxIcon,
},
stripeTax: {
label: "Stripe Tax",
icon: StripeTaxIcon,
},
} satisfies Record<
ProviderNameWithStripeTax,
{
label: string;
icon: string;
}
>;
export const ProviderLabel = ({ name }: { name: ProviderNameWithStripeTax }) => {
const { label, icon } = providerConfig[name];
return (
<Box alignItems={"center"} display={"flex"} gap={3}>
<Image src={icon} width={20} height={20} alt={`provider icon`} />
<Text variant="bodyStrong">{label}</Text>
</Box>
);
};