fix(ui) Add min width to the usage stats component (#10056)

This commit is contained in:
Chris Collins 2024-03-22 15:01:21 -07:00 committed by GitHub
parent 7315e6c40d
commit 36e12f7524
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,7 +49,12 @@ export default function FieldUsageStats({ expandedField }: Props) {
<SectionHeader>Usage</SectionHeader>
<UsageBarWrapper>
<UsageBarBackground>
<UsageBar width={((relevantUsageStats.count || 0) / maxFieldUsageCount) * USAGE_BAR_MAX_WIDTH} />
<UsageBar
width={Math.max(
((relevantUsageStats.count || 0) / maxFieldUsageCount) * USAGE_BAR_MAX_WIDTH,
4,
)}
/>
</UsageBarBackground>
<UsageTextWrapper>{relevantUsageStats.count || 0} queries / month</UsageTextWrapper>
</UsageBarWrapper>