feat: colors for card tags

This commit is contained in:
2025-03-13 19:28:12 +04:00
parent 86115f0263
commit e32ec1ff23
14 changed files with 177 additions and 31 deletions

View File

@@ -0,0 +1,30 @@
import { CardTagSchema } from "../../client";
import { Pill, useMantineColorScheme } from "@mantine/core";
type Props = {
tag: Partial<CardTagSchema>;
}
const CardTag = ({ tag }: Props) => {
const theme = useMantineColorScheme();
let color = "lightgray";
if (tag?.tagColor?.backgroundColor === "inherit" && theme.colorScheme == "light") {
color = "gray";
}
return (
<Pill
key={tag.id}
style={{
color,
backgroundColor: tag?.tagColor?.backgroundColor,
border: "1px solid " + tag?.tagColor?.color,
}}
>
{tag.name}
</Pill>
);
};
export default CardTag;