Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update executeJobModal.tsx #15

Closed
wants to merge 0 commits into from
Closed

Update executeJobModal.tsx #15

wants to merge 0 commits into from

Conversation

and189
Copy link
Contributor

@and189 and189 commented Nov 28, 2023

add search filter

@@ -41,7 +44,16 @@ export const ExecuteJobModal = ({ closeModal, devices, jobId }: ExecuteJobModalP
<Text h3>Execute {jobId}</Text>
</Modal.Header>
<Modal.Body>
{devices && (
<Input
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use the search component from https://github.com/UnownHash/Rotom/blob/main/packages/client/src/app/status/search.tsx

Example implementation:

<SearchInput value={search} onChange={setSearch} />

Copy link
Contributor

@na-ji na-ji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR

Comment on lines 17 to 18
const filteredDevices = devices?.filter(device =>
device.deviceId?.includes(filter) || device.origin?.includes(filter)) || [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should memoize the filtering by using the useMemo hook. Also, as mentionned by GitHub, your indentation isn't right here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants