badges
This commit is contained in:
@@ -1,22 +1,33 @@
|
||||
import { Divider, Group, Text, UnstyledButton } from "@mantine/core";
|
||||
import { Divider, Group, Loader, Text, UnstyledButton } from "@mantine/core";
|
||||
import { CaretRightIcon, Icon } from "@phosphor-icons/react";
|
||||
|
||||
interface ListButtonProps {
|
||||
label: string;
|
||||
Icon: Icon;
|
||||
onClick: () => void;
|
||||
loading?: boolean;
|
||||
}
|
||||
|
||||
const ListButton = ({ label, onClick, Icon }: ListButtonProps) => {
|
||||
const ListButton = ({ label, onClick, Icon, loading }: ListButtonProps) => {
|
||||
return (
|
||||
<>
|
||||
<UnstyledButton w="100%" p="md" component={"button"} onClick={onClick}>
|
||||
<UnstyledButton
|
||||
w="100%"
|
||||
p="md"
|
||||
component={"button"}
|
||||
onClick={onClick}
|
||||
disabled={loading}
|
||||
>
|
||||
<Group>
|
||||
<Icon weight="bold" size={20} />
|
||||
<Text fw={500} size="md">
|
||||
{label}
|
||||
</Text>
|
||||
<CaretRightIcon style={{ marginLeft: "auto" }} size={20} />
|
||||
{loading ? (
|
||||
<Loader size="sm" style={{ marginLeft: "auto" }} />
|
||||
) : (
|
||||
<CaretRightIcon style={{ marginLeft: "auto" }} size={20} />
|
||||
)}
|
||||
</Group>
|
||||
</UnstyledButton>
|
||||
<Divider />
|
||||
|
||||
Reference in New Issue
Block a user