Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 2608dce

Browse files
committed
chore: add dynamic token label
1 parent 716a52b commit 2608dce

File tree

1 file changed

+9
-1
lines changed
  • src/features/dashboard/components/ApiTokenForm/CreateTokenField

1 file changed

+9
-1
lines changed

src/features/dashboard/components/ApiTokenForm/CreateTokenField/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const CreateTokenField = ({
3636
}: TCreateTokenField) => {
3737
const { tokens } = useApiToken();
3838
const [input_value, setInputValue] = useState('');
39+
const numberOfTokens = tokens.length;
3940

4041
useEffect(() => {
4142
if (form_is_cleared) {
@@ -84,12 +85,19 @@ const CreateTokenField = ({
8485
type='text'
8586
name='name'
8687
{...register}
87-
placeholder=' '
88+
placeholder=''
8889
/>
8990
<Button disabled={disable_button} type='submit'>
9091
Create
9192
</Button>
9293
{is_toggle && <TokenCreationDialogSuccess setToggleModal={setToggleModal} />}
94+
<label
95+
htmlFor='playground-request'
96+
className={styles.inlineLabel}
97+
data-testid='token-count-label'
98+
>
99+
Token name (You&apos;ve created <b>{numberOfTokens}</b> out of 30 tokens )
100+
</label>
93101
</div>
94102
{errors && errors.name && (
95103
<Text as='span' type='paragraph-1' className='error-message'>

0 commit comments

Comments
 (0)