mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-04-28 11:27:57 +00:00
34 lines
694 B
TypeScript
34 lines
694 B
TypeScript
// Copyright 2017-2026 @pezkuwi/app-storage authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { QueryTypes } from './types.js';
|
|
|
|
import React from 'react';
|
|
|
|
import Query from './Query.js';
|
|
|
|
interface Props {
|
|
onRemove: (id: number) => void;
|
|
value?: QueryTypes[];
|
|
}
|
|
|
|
function Queries ({ onRemove, value }: Props): React.ReactElement<Props> | null {
|
|
if (!value?.length) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<section className='storage--Queries'>
|
|
{value.map((query): React.ReactNode =>
|
|
<Query
|
|
key={query.id}
|
|
onRemove={onRemove}
|
|
value={query}
|
|
/>
|
|
)}
|
|
</section>
|
|
);
|
|
}
|
|
|
|
export default React.memo(Queries);
|