mirror of https://github.com/MaxLeiter/Drift
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
577 B
TypeScript
24 lines
577 B
TypeScript
import { Badge } from "@geist-ui/core"
|
|
import type { PostVisibility } from "@lib/types"
|
|
|
|
type Props = {
|
|
visibility: PostVisibility
|
|
}
|
|
|
|
const VisibilityBadge = ({ visibility }: Props) => {
|
|
const getBadgeType = () => {
|
|
switch (visibility) {
|
|
case "public":
|
|
return "success"
|
|
case "private":
|
|
return "warning"
|
|
case "unlisted":
|
|
return "default"
|
|
}
|
|
}
|
|
|
|
return (<Badge marginLeft={'var(--gap)'} type={getBadgeType()}>{visibility}</Badge>)
|
|
}
|
|
|
|
export default VisibilityBadge
|