mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 15:36:02 +01:00
feat(web/context): allow separate metadata progress bars colors
Closes #430
This commit is contained in:
@@ -145,14 +145,21 @@ const ContextButton: React.FC<{
|
||||
{button.image && <Image src={button.image} />}
|
||||
{Array.isArray(button.metadata) ? (
|
||||
button.metadata.map(
|
||||
(metadata: string | { label: string; value?: any; progress?: number }, index: number) => (
|
||||
(
|
||||
metadata: string | { label: string; value?: any; progress?: number; colorScheme?: string },
|
||||
index: number
|
||||
) => (
|
||||
<>
|
||||
<Text key={`context-metadata-${index}`}>
|
||||
{typeof metadata === 'string' ? `${metadata}` : `${metadata.label}: ${metadata?.value ?? ''}`}
|
||||
</Text>
|
||||
|
||||
{typeof metadata === 'object' && metadata.progress !== undefined && (
|
||||
<Progress value={metadata.progress} size="sm" color={button.colorScheme || 'dark.3'} />
|
||||
<Progress
|
||||
value={metadata.progress}
|
||||
size="sm"
|
||||
color={metadata.colorScheme || button.colorScheme || 'dark.3'}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user