5180 fichiers 38.5 Mo 0 téléchargements 303 vues mis à jour il y a 6 heures ui
nitro-v36-with-renderer-v36 / src / components / wired / views / WiredFurniSelectorView.tsx
WiredFurniSelectorView.tsx 1.4 Ko Télécharger le fichier
import { FC } from 'react';
import { LocalizeText } from '../../../api';
import { Text } from '../../../common';
import { NativeTextTree } from '../../../common/native-text/NativeTextTree';
import { useWired } from '../../../hooks';

export const WiredFurniSelectorView: FC<{}> = () => {
    const { trigger = null, furniIds = [] } = useWired();

    const count = furniIds?.length ?? 0;
    const limit = trigger?.maximumItemSelectionCount ?? 0;

    // The shipped caption template historically omitted %count% ("Select Furni [/%limit%]"), so the
    // selected count never rendered and appeared frozen at "[/20]". Inject the count when the
    // localized text still lacks a "count/limit" figure — works with both the old and fixed template.
    const rawCaption = LocalizeText('wiredfurni.pickfurnis.caption', ['count', 'limit'], [count.toString(), limit.toString()]);
    const caption = /\d+\s*\/\s*\d+/.test(rawCaption) ? rawCaption : rawCaption.replace(/\[\s*\//, `[${count}/`);

    return (
        <NativeTextTree>
            <div className="flex flex-col gap-1 octane-wired__furni-selector">
                <Text bold className="octane-wired__furni-selector-title">
                    {caption}
                </Text>
                <Text small className="octane-wired__furni-selector-description">
                    {LocalizeText('wiredfurni.pickfurnis.desc')}
                </Text>
            </div>
        </NativeTextTree>
    );
};
15Sujets
1Dépôts
20Membres
2En ligne
Profile
Inscrit
Dernière visite
Messages
0
Votes positifs
0
Votes négatifs
0

Nous utilisons des cookies pour assurer le bon fonctionnement du site et améliorer votre expérience. en savoir plus

Autoriser