import React from 'react'
import classnames from 'classnames'
import type { ReactNode } from 'react'
import type { SnippetType } from '../../types/Snippet'
export type BadgeName = SnippetType | 'core' | 'pro' | 'ai' | 'cloud' | 'bundles' | 'cloud_search' | 'beta'
const badgeIcons: Partial<Record<BadgeName, string>> = {
cond: 'randomize',
cloud: 'cloud',
bundles: 'screenoptions',
cloud_search: 'search'
}
export interface BadgeProps {
name: BadgeName
small?: boolean
inverted?: boolean
children?: ReactNode
}
export const Badge: React.FC<BadgeProps> = ({ name, small, inverted, children }) =>
<span className={classnames('badge', `${name}-badge`, { 'small-badge': small, 'inverted-badge': inverted })}>
{badgeIcons[name]
? <span className={`dashicons dashicons-${badgeIcons[name]}`} />
: children ?? name}
</span>
| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| icons/ | 2026-07-30 21:37 | 2.3 KB | 76129f60960:kunden | dxwrx-r--r | |
| Badge.tsx | 2026-07-30 21:37 | 838 B | 76129f60960:kunden | -xw-x----- | |
| Button.tsx | 2026-07-30 21:37 | 929 B | 76129f60960:kunden | -xw-x----- | |
| ConfirmDialog.tsx | 2026-07-30 21:37 | 1.1 KB | 76129f60960:kunden | -xw-x----- | |
| CopyToClipboardButton.tsx | 2026-07-30 21:37 | 1.64 KB | 76129f60960:kunden | -xw-x----- | |
| DismissableNotice.tsx | 2026-07-30 21:37 | 700 B | 76129f60960:kunden | -xw-x----- | |
| SubmitButton.tsx | 2026-07-30 21:37 | 913 B | 76129f60960:kunden | -xw-x----- | |
| Tooltip.tsx | 2026-07-30 21:37 | 681 B | 76129f60960:kunden | -xw-x----- | |
| UpsellBanner.tsx | 2026-07-30 21:37 | 1.16 KB | 76129f60960:kunden | -xw-x----- | |
| UpsellDialog.tsx | 2026-07-30 21:37 | 2.11 KB | 76129f60960:kunden | -xw-x----- | |