✨ feat(subscribe): Update suffix from 'MB' to 'Mbps' and enhance speed limit display logic
This commit is contained in:
parent
10d322f1ba
commit
3547bb1596
@ -190,7 +190,7 @@ export default function NodeForm<T extends { [x: string]: any }>({
|
|||||||
onValueChange={(value) => {
|
onValueChange={(value) => {
|
||||||
form.setValue(field.name, value);
|
form.setValue(field.name, value);
|
||||||
}}
|
}}
|
||||||
suffix='MB'
|
suffix='Mbps'
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
|
|||||||
@ -277,7 +277,7 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
|||||||
{...field}
|
{...field}
|
||||||
formatInput={(value) => unitConversion('bitsToMb', value)}
|
formatInput={(value) => unitConversion('bitsToMb', value)}
|
||||||
formatOutput={(value) => unitConversion('mbToBits', value)}
|
formatOutput={(value) => unitConversion('mbToBits', value)}
|
||||||
suffix='MB'
|
suffix='Mbps'
|
||||||
onValueChange={(value) => {
|
onValueChange={(value) => {
|
||||||
form.setValue(field.name, value);
|
form.setValue(field.name, value);
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { Display } from '@/components/display';
|
import { Display } from '@/components/display';
|
||||||
|
import { unitConversion } from '@workspace/ui/utils';
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
|
|
||||||
interface SubscribeDetailProps {
|
interface SubscribeDetailProps {
|
||||||
@ -36,7 +37,11 @@ export function SubscribeDetail({ subscribe }: Readonly<SubscribeDetailProps>) {
|
|||||||
<li>
|
<li>
|
||||||
<span className='text-muted-foreground'>{t('connectionSpeed')}</span>
|
<span className='text-muted-foreground'>{t('connectionSpeed')}</span>
|
||||||
<span>
|
<span>
|
||||||
<Display type='traffic' value={subscribe?.speed_limit} unlimited />
|
{subscribe?.speed_limit ? (
|
||||||
|
`${unitConversion('bitsToMb', subscribe?.speed_limit)} Mbps`
|
||||||
|
) : (
|
||||||
|
<Display type='traffic' value={subscribe?.speed_limit} unlimited />
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user