import styled from '@emotion/styled'; import Button from 'sentry/components/actions/button'; import Checkbox from 'sentry/components/checkbox'; import {DropdownMenu} from 'sentry/components/dropdownMenu'; import ErrorBoundary from 'sentry/components/errorBoundary'; import decodeMailbox from 'sentry/components/feedback/decodeMailbox'; import MailboxPicker from 'sentry/components/feedback/list/mailboxPicker'; import PanelItem from 'sentry/components/panels/panelItem'; import {Flex} from 'sentry/components/profiling/flex'; import {IconEllipsis} from 'sentry/icons/iconEllipsis'; import {t, tct} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import useLocationQuery from 'sentry/utils/url/useLocationQuery'; import useUrlParams from 'sentry/utils/useUrlParams'; interface Props { checked: string[]; toggleChecked: (id: string) => void; } export default function FeedbackListHeader({checked, toggleChecked}: Props) { const {mailbox} = useLocationQuery({ fields: { mailbox: decodeMailbox, }, }); const {setParamValue: setMailbox} = useUrlParams('mailbox'); return ( { checked.length ? checked.forEach(c => toggleChecked(c)) : null; }} /> {checked.length ? ( ) : ( )} ); } function HasSelection({checked, mailbox}) { return ( {tct('[count] Selected', {count: checked.length})} , showChevron: false, size: 'xs', }} items={[ { key: 'mark read', label: t('Mark Read'), onAction: () => {}, }, { key: 'mark unread', label: t('Mark Unread'), onAction: () => {}, }, ]} /> ); } const HeaderPanelItem = styled(PanelItem)` display: flex; padding: ${space(1)} ${space(2)} ${space(1)} ${space(2)}; gap: ${space(1)}; align-items: center; `;