Skip to content

Commit

Permalink
tag editor example
Browse files Browse the repository at this point in the history
  • Loading branch information
timogasda committed Aug 10, 2023
1 parent c606b1d commit e3b69be
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pages/tag-editor/simple.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,23 @@ import Button from '~components/button';
import { I18N_STRINGS } from './shared';

const KEYS = range(15).map(i => `Tag ${i + 1}`);
const VALUES = range(15).map(i => `Value ${i + 1}`);
const VALUES = range(15).map(
i =>
`arn:aws:cloudformation:us-east-1:3850${i % 10}95${
(i + 3) % 10
}34:stack/apples-to-apples/324534634-234234-66-324235`
);

async function requestKeys(input: string): Promise<string[]> {
await new Promise(resolve => setTimeout(resolve, 2000));
await new Promise(resolve => setTimeout(resolve, 500));
return KEYS.filter(key => key.indexOf(input) !== -1);
}

async function requestValues(key: string, input: string): Promise<string[]> {
if (!key) {
return Promise.reject();
}
await new Promise(resolve => setTimeout(resolve, 2000));
await new Promise(resolve => setTimeout(resolve, 500));
return VALUES.map(value => `${key} - ${value}`).filter(value => value.indexOf(input) !== -1);
}

Expand Down

0 comments on commit e3b69be

Please sign in to comment.