mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-18 07:24:07 +01:00
31 lines
920 B
TypeScript
31 lines
920 B
TypeScript
import { memo } from 'react';
|
|
import { useActiveRequestId } from '../hooks/useActiveRequestId';
|
|
import { useDeleteRequest } from '../hooks/useDeleteRequest';
|
|
import { Dropdown } from './core/Dropdown';
|
|
import { Icon } from './core/Icon';
|
|
import { IconButton } from './core/IconButton';
|
|
|
|
export const RequestSettingsDropdown = memo(function RequestSettingsDropdown() {
|
|
const activeRequestId = useActiveRequestId();
|
|
const deleteRequest = useDeleteRequest(activeRequestId ?? null);
|
|
return (
|
|
<Dropdown
|
|
items={[
|
|
{
|
|
label: 'Something Else',
|
|
onSelect: () => null,
|
|
leftSlot: <Icon icon="camera" />,
|
|
},
|
|
'-----',
|
|
{
|
|
label: 'Delete Request',
|
|
onSelect: deleteRequest.mutate,
|
|
leftSlot: <Icon icon="trash" />,
|
|
},
|
|
]}
|
|
>
|
|
<IconButton size="sm" title="Request Options" icon="gear" />
|
|
</Dropdown>
|
|
);
|
|
});
|