> For AI agents: the complete documentation index is available at https://wallarm.github.io/design-system/llms.txt, the full documentation bundle is available at https://wallarm.github.io/design-system/llms-full.txt.

# Incident detail

**Components:** [`Page`](https://wallarm.github.io/design-system/components/page.md), [`PageHeader`](https://wallarm.github.io/design-system/components/page.md), [`PageHeaderGroup`](https://wallarm.github.io/design-system/components/page.md), [`PageTitle`](https://wallarm.github.io/design-system/components/page.md), [`PageActions`](https://wallarm.github.io/design-system/components/page.md), [`PageContent`](https://wallarm.github.io/design-system/components/page.md), [`Tabs`](https://wallarm.github.io/design-system/components/tabs.md), [`TabsList`](https://wallarm.github.io/design-system/components/tabs.md)


+58 more

[`TabsTrigger`](https://wallarm.github.io/design-system/components/tabs.md), [`TabsContent`](https://wallarm.github.io/design-system/components/tabs.md), [`NumericBadge`](https://wallarm.github.io/design-system/components/numeric-badge.md), [`Badge`](https://wallarm.github.io/design-system/components/badge.md), [`SplitButton`](https://wallarm.github.io/design-system/components/split-button.md), [`Button`](https://wallarm.github.io/design-system/components/button.md), [`DropdownMenu`](https://wallarm.github.io/design-system/components/dropdown-menu.md), [`DropdownMenuTrigger`](https://wallarm.github.io/design-system/components/dropdown-menu.md), [`DropdownMenuContent`](https://wallarm.github.io/design-system/components/dropdown-menu.md), [`DropdownMenuItem`](https://wallarm.github.io/design-system/components/dropdown-menu.md), [`DropdownMenuRadioGroup`](https://wallarm.github.io/design-system/components/dropdown-menu.md), [`DropdownMenuRadioItem`](https://wallarm.github.io/design-system/components/dropdown-menu.md), [`Avatar`](https://wallarm.github.io/design-system/components/avatar.md), [`AvatarFallback`](https://wallarm.github.io/design-system/components/avatar.md), [`Alert`](https://wallarm.github.io/design-system/components/alert.md), [`AlertContent`](https://wallarm.github.io/design-system/components/alert.md), [`AlertTitle`](https://wallarm.github.io/design-system/components/alert.md), [`AlertDescription`](https://wallarm.github.io/design-system/components/alert.md), [`AlertControls`](https://wallarm.github.io/design-system/components/alert.md), [`Attribute`](https://wallarm.github.io/design-system/components/attribute.md), [`AttributeLabel`](https://wallarm.github.io/design-system/components/attribute.md), [`AttributeValue`](https://wallarm.github.io/design-system/components/attribute.md), [`InlineCodeSnippet`](https://wallarm.github.io/design-system/components/code-snippet.md), [`HttpMethod`](https://wallarm.github.io/design-system/components/http-method.md), [`Ip`](https://wallarm.github.io/design-system/components/ip.md), [`IpCountry`](https://wallarm.github.io/design-system/components/ip.md), [`IpAddress`](https://wallarm.github.io/design-system/components/ip.md), [`FormatNumber`](https://wallarm.github.io/design-system/components/format-number.md), [`FormatDateTime`](https://wallarm.github.io/design-system/components/format-date-time.md), [`CodeSnippetRoot`](https://wallarm.github.io/design-system/components/code-snippet.md), [`CodeSnippetHeader`](https://wallarm.github.io/design-system/components/code-snippet.md), [`CodeSnippetContent`](https://wallarm.github.io/design-system/components/code-snippet.md), [`CodeSnippetCode`](https://wallarm.github.io/design-system/components/code-snippet.md), [`Card`](https://wallarm.github.io/design-system/components/card.md), [`CardHeader`](https://wallarm.github.io/design-system/components/card.md), [`CardTitle`](https://wallarm.github.io/design-system/components/card.md), [`CardContent`](https://wallarm.github.io/design-system/components/card.md), [`Timeline`](https://wallarm.github.io/design-system/components/timeline.md), [`TimelineItem`](https://wallarm.github.io/design-system/components/timeline.md), [`TimelineIndicator`](https://wallarm.github.io/design-system/components/timeline.md), [`TimelineContent`](https://wallarm.github.io/design-system/components/timeline.md), [`TimelineTitle`](https://wallarm.github.io/design-system/components/timeline.md), [`TimelineDescription`](https://wallarm.github.io/design-system/components/timeline.md), [`Table`](https://wallarm.github.io/design-system/components/table.md), [`Code`](https://wallarm.github.io/design-system/components/code.md), [`ResponseCode`](https://wallarm.github.io/design-system/components/response-code.md), [`Dialog`](https://wallarm.github.io/design-system/components/dialog.md), [`DialogContent`](https://wallarm.github.io/design-system/components/dialog.md), [`DialogTitle`](https://wallarm.github.io/design-system/components/dialog.md), [`DialogDescription`](https://wallarm.github.io/design-system/components/dialog.md), [`DialogFooter`](https://wallarm.github.io/design-system/components/dialog.md), [`Textarea`](https://wallarm.github.io/design-system/components/textarea.md), [`Field`](https://wallarm.github.io/design-system/components/field.md), [`Skeleton`](https://wallarm.github.io/design-system/components/skeleton.md), [`Heading`](https://wallarm.github.io/design-system/components/heading.md), [`Text`](https://wallarm.github.io/design-system/components/text.md), [`HStack`](https://wallarm.github.io/design-system/components/stack.md), [`VStack`](https://wallarm.github.io/design-system/components/stack.md)

One security incident on a full page. The header says what it is, how bad it is, who owns it and what to do next; four tabs hold the evidence. Swap the domain words and the same screen serves a vulnerability, a finding or any record with a lifecycle.

## What it shows

- The page shell from [Resource list page](https://wallarm.github.io/design-system/patterns/resource-list-page.md), with `TabsList` between `PageHeader` and `PageContent`.
- The header: `PageTitle`, a solid severity `Badge`, a dotted status `Badge`, and the ID, host and open time as secondary text. `PageActions` holds an assignee `DropdownMenuRadioGroup`, a `SplitButton` (Resolve, then other resolutions in its menu) and an overflow menu.
- Overview: an `Alert` while the attack runs, the attribute card from [Complex drawer](https://wallarm.github.io/design-system/patterns/complex-drawer.md), the description and a `CodeSnippetRoot` request. A `Card` beside it holds the latest `Timeline` entries.
- Timeline: every entry newest first, with an icon `TimelineIndicator` colored by who acted.
- Related events: an [Entity table](https://wallarm.github.io/design-system/patterns/entity-table.md) with `HttpMethod`, `Ip`, `Code`, `ResponseCode`, a dotted result `Badge` and a row menu in the master cell.
- Comments: an `Avatar` per author and a `Field` with `Textarea` to add one.
- "Mark as false positive" is a [Confirmation dialog](https://wallarm.github.io/design-system/patterns/confirmation-dialogs.md); Resolve is reversible, so it runs at once. Both report with [Feedback toasts](https://wallarm.github.io/design-system/patterns/feedback-toasts.md).
- Loading keeps the tabs and actions in place, with the skeletons from [Complex drawer](https://wallarm.github.io/design-system/patterns/complex-drawer.md) and [Entity table](https://wallarm.github.io/design-system/patterns/entity-table.md).

## Examples

The whole page on the Overview tab. Open the Resolve split button's menu and pick "Mark as false positive" to see the confirmation dialog.

The whole page on the Overview tab. The header carries the title, severity, status,
assignee menu and a split button: "Resolve" is the default action, the chevron opens
"Mark as false positive" (confirmed in a dialog) and other resolutions. Overview pairs the
bordered attribute card, the description and a sample request with a card of the latest
timeline entries. Every tab is live: the timeline, a related-events table and comments.

```tsx
import { type ChangeEvent, useState } from 'react';
import { Alert, AlertContent, AlertControls, AlertDescription, AlertIcon, AlertTitle } from '@wallarm-org/design-system/Alert';
import { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';
import { Avatar, AvatarContent, AvatarDescription, AvatarFallback, AvatarName } from '@wallarm-org/design-system/Avatar';
import { Badge } from '@wallarm-org/design-system/Badge';
import { Button } from '@wallarm-org/design-system/Button';
import { Card, CardContent, CardHeader, CardTitle } from '@wallarm-org/design-system/Card';
import { Code } from '@wallarm-org/design-system/Code';
import { CodeSnippetActions, CodeSnippetCode, CodeSnippetContent, CodeSnippetCopyButton, CodeSnippetHeader, CodeSnippetLineNumbers, CodeSnippetRoot, CodeSnippetTitle, CodeSnippetWrapButton, InlineCodeSnippet } from '@wallarm-org/design-system/CodeSnippet';
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@wallarm-org/design-system/Dialog';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemIcon, DropdownMenuItemText, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';
import { Field, FieldLabel } from '@wallarm-org/design-system/Field';
import { FormatDateTime } from '@wallarm-org/design-system/FormatDateTime';
import { FormatNumber } from '@wallarm-org/design-system/FormatNumber';
import { Heading } from '@wallarm-org/design-system/Heading';
import { HttpMethod } from '@wallarm-org/design-system/HttpMethod';
import { ChevronDown, CircleCheck, Copy, Download, Ellipsis, ExternalLink, Flag, MessageSquare, ShieldAlert, ShieldCheck } from '@wallarm-org/design-system/icons';
import { Ip, IpAddress, IpCountry } from '@wallarm-org/design-system/Ip';
import { NumericBadge } from '@wallarm-org/design-system/NumericBadge';
import { Page, PageActions, PageContent, PageHeader, PageHeaderGroup, PageTitle } from '@wallarm-org/design-system/Page';
import { ResponseCode } from '@wallarm-org/design-system/ResponseCode';
import { Skeleton } from '@wallarm-org/design-system/Skeleton';
import { SplitButton } from '@wallarm-org/design-system/SplitButton';
import { HStack, VStack } from '@wallarm-org/design-system/Stack';
import { type TableCellContext, type TableColumnDef, type TableRow, Table } from '@wallarm-org/design-system/Table';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@wallarm-org/design-system/Tabs';
import { Text } from '@wallarm-org/design-system/Text';
import { Textarea } from '@wallarm-org/design-system/Textarea';
import { Timeline, TimelineConnector, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, TimelineSeparator, TimelineTitle } from '@wallarm-org/design-system/Timeline';
import { useToast } from '@wallarm-org/design-system/Toast';

export const Default = ({
  initialTab = 'overview',
  isLoading = false,
}) => {
  const toast = useToast();
  const [tab, setTab] = useState(initialTab);
  const [status, setStatus] = useState<IncidentStatus>('open');
  const [assignee, setAssignee] = useState('Daniel Okafor');
  const [dialogOpen, setDialogOpen] = useState(false);
  const [pending, setPending] = useState(false);
  const [comments, setComments] = useState(COMMENTS);
  const [draft, setDraft] = useState('');

  const renderRequest = ({ row }: TableCellContext<RelatedEvent, unknown>) => (
    <HStack gap={8}>
      <HttpMethod method={row.original.method} />
      <Text size='sm' truncate>
        {row.original.path}
      </Text>
    </HStack>
  );
  const renderSource = ({ row }: TableCellContext<RelatedEvent, unknown>) => (
    <Ip>
      <IpCountry code={row.original.country} />
      <IpAddress>{row.original.ip}</IpAddress>
    </Ip>
  );
  const renderPayload = ({ row }: TableCellContext<RelatedEvent, unknown>) => (
    <Code size='m' truncate>
      {row.original.payload}
    </Code>
  );
  const renderResponse = ({ row }: TableCellContext<RelatedEvent, unknown>) => (
    <ResponseCode code={row.original.responseCode} />
  );
  const renderAction = ({ row }: TableCellContext<RelatedEvent, unknown>) => (
    <Badge variant='dotted' type='secondary' color={ACTION[row.original.action].color}>
      {ACTION[row.original.action].label}
    </Badge>
  );
  const renderTime = ({ row }: TableCellContext<RelatedEvent, unknown>) => (
    <FormatDateTime value={row.original.at} format='datetime' layout='inline' />
  );

  const renderEventMenu = (row: TableRow<RelatedEvent>) => {
    const event = row.original;
    const handleOpen = () => onOpenRequest(event.id);
    const handleCopyId = () => onCopyRequestId(event.id);

    return (
      <DropdownMenu data-testid='incident-event-menu'>
        <DropdownMenuTrigger asChild>
          <Button
            variant='ghost'
            color='neutral'
            size='small'
            aria-label={`Actions for request ${event.id}`}
          >
            <Ellipsis />
          </Button>
        </DropdownMenuTrigger>
        <DropdownMenuContent>
          <DropdownMenuItem onSelect={handleOpen}>
            <DropdownMenuItemText>Open request</DropdownMenuItemText>
          </DropdownMenuItem>
          <DropdownMenuItem onSelect={handleCopyId}>
            <DropdownMenuItemText>Copy request ID</DropdownMenuItemText>
          </DropdownMenuItem>
        </DropdownMenuContent>
      </DropdownMenu>
    );
  };

  const eventColumns: TableColumnDef<RelatedEvent>[] = [
    {
      id: 'request',
      header: 'Request',
      size: 320,
      cell: renderRequest,
      meta: { renderMenuAction: renderEventMenu },
    },
    { accessorKey: 'ip', header: 'Source', size: 200, cell: renderSource },
    { accessorKey: 'payload', header: 'Payload', size: 360, cell: renderPayload },
    { accessorKey: 'responseCode', header: 'Response', size: 120, cell: renderResponse },
    { accessorKey: 'action', header: 'Result', size: 140, cell: renderAction },
    { accessorKey: 'at', header: 'Time', size: 200, cell: renderTime },
  ];

  const isOpen = status === 'open';

  const handleResolve = () => {
    onResolve(INCIDENT.id);
    setStatus(isOpen ? 'resolved' : 'open');
    toast.create({
      id: 'incident-resolution',
      title: isOpen ? 'Incident resolved' : 'Incident reopened',
      type: 'default',
    });
  };
  const handleOpenFalsePositive = () => setDialogOpen(true);
  const handleAcceptRisk = () => onAcceptRisk(INCIDENT.id);
  const handleCreateTicket = () => onCreateTicket(INCIDENT.id);
  const handleCopyLink = () => onCopyLink(INCIDENT.id);
  const handleExport = () => onExport(INCIDENT.id);
  const handleAssigneeChange = ({ value }: { value: string }) => {
    onAssign(value);
    setAssignee(value);
  };
  const handleShowTimeline = () => setTab('timeline');
  const handleShowEvents = () => setTab('events');
  const handleDialogOpenChange = (next: boolean) => {
    if (!pending) setDialogOpen(next);
  };
  const handleConfirmFalsePositive = async () => {
    setPending(true);
    try {
      await markFalsePositive(INCIDENT.id);
      setStatus('false-positive');
      setDialogOpen(false);
      toast.create({ title: 'Marked as false positive', type: 'default' });
    } catch {
      toast.create({ title: "Couldn't mark as false positive", type: 'error' });
    } finally {
      setPending(false);
    }
  };
  const handleDraftChange = (event: ChangeEvent<HTMLTextAreaElement>) =>
    setDraft(event.target.value);
  const handleAddComment = () => {
    const body = draft.trim();
    if (!body) return;
    onAddComment(body);
    setComments(prev => [
      ...prev,
      {
        id: `c-${prev.length + 1}`,
        author: assignee,
        role: 'Security analyst',
        body,
        at: new Date().toISOString(),
      },
    ]);
    setDraft('');
  };

  return (
    <Page name='incident-detail' fullSize fixedHeight data-testid='incident-page'>
      <PageHeader>
        <PageHeaderGroup className='flex-1 gap-6'>
          {isLoading ? (
            <>
              <Skeleton width='480px' height='28px' rounded={6} />
              <Skeleton width='320px' height='20px' rounded={6} />
            </>
          ) : (
            <>
              <PageTitle>{INCIDENT.title}</PageTitle>
              <HStack gap={8} data-testid='incident-meta'>
                <Badge color='red' type='solid'>
                  <ShieldAlert />
                  Critical
                </Badge>
                <Badge
                  variant='dotted'
                  type='secondary'
                  color={STATUS[status].color}
                  data-testid='incident-status'
                >
                  {STATUS[status].label}
                </Badge>
                <Text size='sm' color='secondary'>
                  {INCIDENT.id} · {INCIDENT.host} · opened
                </Text>
                <FormatDateTime value={INCIDENT.firstSeen} format='datetime' layout='inline' />
              </HStack>
            </>
          )}
        </PageHeaderGroup>
        <PageActions>
          <DropdownMenu>
            <DropdownMenuTrigger asChild>
              <Button
                variant='outline'
                color='neutral'
                size='medium'
                disabled={isLoading}
                data-testid='incident-assignee'
              >
                <Avatar size='sm'>
                  <AvatarFallback name={assignee} />
                </Avatar>
                {assignee}
                <ChevronDown />
              </Button>
            </DropdownMenuTrigger>
            <DropdownMenuContent>
              <DropdownMenuLabel>Assignee</DropdownMenuLabel>
              <DropdownMenuRadioGroup value={assignee} onValueChange={handleAssigneeChange}>
                {ANALYSTS.map(name => (
                  <DropdownMenuRadioItem key={name} value={name}>
                    {name}
                  </DropdownMenuRadioItem>
                ))}
              </DropdownMenuRadioGroup>
            </DropdownMenuContent>
          </DropdownMenu>

          <DropdownMenu>
            <SplitButton data-testid='incident-resolve'>
              <Button
                size='medium'
                disabled={isLoading}
                onClick={handleResolve}
                data-testid='incident-resolve-primary'
              >
                {isOpen ? <CircleCheck /> : null}
                {isOpen ? 'Resolve' : 'Reopen'}
              </Button>
              <DropdownMenuTrigger asChild>
                <Button
                  size='medium'
                  disabled={isLoading || !isOpen}
                  aria-label='More ways to resolve'
                  data-testid='incident-resolve-menu'
                >
                  <ChevronDown />
                </Button>
              </DropdownMenuTrigger>
            </SplitButton>
            <DropdownMenuContent>
              <DropdownMenuItem
                onSelect={handleOpenFalsePositive}
                data-testid='incident-false-positive'
              >
                <DropdownMenuItemIcon>
                  <Flag />
                </DropdownMenuItemIcon>
                <DropdownMenuItemText>Mark as false positive</DropdownMenuItemText>
              </DropdownMenuItem>
              <DropdownMenuItem onSelect={handleAcceptRisk}>
                <DropdownMenuItemIcon>
                  <ShieldCheck />
                </DropdownMenuItemIcon>
                <DropdownMenuItemText>Accept risk</DropdownMenuItemText>
              </DropdownMenuItem>
              <DropdownMenuItem onSelect={handleCreateTicket}>
                <DropdownMenuItemIcon>
                  <ExternalLink />
                </DropdownMenuItemIcon>
                <DropdownMenuItemText>Create Jira ticket</DropdownMenuItemText>
              </DropdownMenuItem>
            </DropdownMenuContent>
          </DropdownMenu>

          <DropdownMenu>
            <DropdownMenuTrigger asChild>
              <Button
                variant='ghost'
                color='neutral'
                size='medium'
                disabled={isLoading}
                aria-label='More actions'
              >
                <Ellipsis />
              </Button>
            </DropdownMenuTrigger>
            <DropdownMenuContent>
              <DropdownMenuItem onSelect={handleCopyLink}>
                <DropdownMenuItemIcon>
                  <Copy />
                </DropdownMenuItemIcon>
                <DropdownMenuItemText>Copy link</DropdownMenuItemText>
              </DropdownMenuItem>
              <DropdownMenuSeparator />
              <DropdownMenuItem onSelect={handleExport}>
                <DropdownMenuItemIcon>
                  <Download />
                </DropdownMenuItemIcon>
                <DropdownMenuItemText>Export report</DropdownMenuItemText>
              </DropdownMenuItem>
            </DropdownMenuContent>
          </DropdownMenu>
        </PageActions>
      </PageHeader>

      <Tabs
        value={tab}
        onChange={setTab}
        className='flex min-h-0 flex-1 flex-col'
        data-testid='incident-tabs'
      >
        <TabsList>
          <TabsTrigger value='overview'>Overview</TabsTrigger>
          <TabsTrigger value='timeline'>
            Timeline {!isLoading && <NumericBadge>{TIMELINE.length}</NumericBadge>}
          </TabsTrigger>
          <TabsTrigger value='events' data-testid='incident-tab-events'>
            Related events {!isLoading && <NumericBadge>{RELATED_EVENTS.length}</NumericBadge>}
          </TabsTrigger>
          <TabsTrigger value='comments'>
            Comments {!isLoading && <NumericBadge>{comments.length}</NumericBadge>}
          </TabsTrigger>
        </TabsList>

        <PageContent>
          <TabsContent value='overview'>
            <div className='grid grid-cols-[minmax(0,1fr)_400px] items-start gap-24'>
              <VStack gap={24}>
                {isOpen && !isLoading && (
                  <Alert color='destructive' data-testid='incident-alert'>
                    <AlertIcon />
                    <AlertContent>
                      <AlertTitle>Attack still in progress</AlertTitle>
                      <AlertDescription>
                        412 requests a minute from 4 addresses. Blocking mode is on for{' '}
                        {INCIDENT.host}, so none reach the application.
                      </AlertDescription>
                    </AlertContent>
                    <AlertControls>
                      <Button
                        variant='secondary'
                        color='neutral'
                        size='small'
                        onClick={handleShowEvents}
                      >
                        View related events
                      </Button>
                    </AlertControls>
                  </Alert>
                )}

                <VStack gap={12}>
                  <Heading as='h2' size='md' weight='medium'>
                    Details
                  </Heading>
                  <div
                    className='grid grid-cols-2 gap-x-8 gap-y-16 rounded-8 border border-border-primary-light p-16'
                    data-testid='incident-attributes'
                  >
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Endpoint</AttributeLabel>
                      <AttributeValue>
                        <HStack gap={6}>
                          <HttpMethod method={INCIDENT.method} />
                          <InlineCodeSnippet code={INCIDENT.path} size='md' />
                        </HStack>
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Host</AttributeLabel>
                      <AttributeValue>
                        <InlineCodeSnippet code={INCIDENT.host} size='md' />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Attack type</AttributeLabel>
                      <AttributeValue>
                        <HStack gap={4}>
                          <Badge type='secondary' color='slate' size='medium'>
                            SQL injection
                          </Badge>
                          <Badge type='secondary' color='slate' size='medium'>
                            CWE-89
                          </Badge>
                        </HStack>
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Parameter</AttributeLabel>
                      <AttributeValue>
                        <InlineCodeSnippet code={INCIDENT.parameter} size='md' />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Detection rule</AttributeLabel>
                      <AttributeValue>
                        <InlineCodeSnippet code={INCIDENT.rule} size='md' />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Requests</AttributeLabel>
                      <AttributeValue>
                        <FormatNumber value={INCIDENT.requests} notation='standard' />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Blocked</AttributeLabel>
                      <AttributeValue>
                        <FormatNumber value={INCIDENT.blockedShare} type='percent' decimals={1} />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>First seen</AttributeLabel>
                      <AttributeValue>
                        <FormatDateTime
                          value={INCIDENT.firstSeen}
                          format='datetime'
                          layout='inline'
                        />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Last seen</AttributeLabel>
                      <AttributeValue>
                        <FormatDateTime
                          value={INCIDENT.lastSeen}
                          format='datetime'
                          layout='inline'
                        />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading} isEmpty={!isLoading}>
                      <AttributeLabel>Ticket</AttributeLabel>
                      <AttributeValue />
                    </Attribute>
                    <Attribute loading={isLoading} className='col-span-2'>
                      <AttributeLabel>Source IPs</AttributeLabel>
                      <AttributeValue>
                        <HStack gap={8}>
                          {INCIDENT.sourceIps.map(source => (
                            <Ip key={source.ip}>
                              <IpCountry code={source.country} />
                              <IpAddress>{source.ip}</IpAddress>
                            </Ip>
                          ))}
                        </HStack>
                      </AttributeValue>
                    </Attribute>
                  </div>
                </VStack>

                <VStack gap={12}>
                  <Heading as='h2' size='md' weight='medium'>
                    Description
                  </Heading>
                  {isLoading ? (
                    <VStack gap={8}>
                      <Skeleton width='100%' height='16px' rounded={4} />
                      <Skeleton width='72%' height='16px' rounded={4} />
                    </VStack>
                  ) : (
                    <Text size='sm'>
                      An automated scanner is sending SQL injection payloads in the customer_id
                      filter of the order search endpoint. Early requests returned 500 while the
                      host was in monitoring mode, which suggests the value reaches the database
                      unescaped. Since blocking was enabled every request is rejected, but the
                      parameter should be fixed at the source.
                    </Text>
                  )}
                </VStack>

                <VStack gap={12}>
                  <Heading as='h2' size='md' weight='medium'>
                    Sample request
                  </Heading>
                  {isLoading ? (
                    <Skeleton width='100%' height='160px' rounded={8} />
                  ) : (
                    <CodeSnippetRoot code={SAMPLE_REQUEST} language='text'>
                      <CodeSnippetHeader>
                        <CodeSnippetTitle>Request r-90412 · blocked</CodeSnippetTitle>
                        <CodeSnippetActions>
                          <CodeSnippetWrapButton />
                          <CodeSnippetCopyButton />
                        </CodeSnippetActions>
                      </CodeSnippetHeader>
                      <CodeSnippetContent>
                        <CodeSnippetLineNumbers />
                        <CodeSnippetCode />
                      </CodeSnippetContent>
                    </CodeSnippetRoot>
                  )}
                </VStack>
              </VStack>

              <Card className='h-auto' data-testid='incident-latest-activity'>
                <CardHeader>
                  <CardTitle>Latest activity</CardTitle>
                  <Button
                    variant='ghost'
                    color='neutral'
                    size='small'
                    disabled={isLoading}
                    onClick={handleShowTimeline}
                  >
                    View timeline
                  </Button>
                </CardHeader>
                <CardContent>
                  {isLoading ? (
                    <VStack gap={16}>
                      <Skeleton width='100%' height='40px' rounded={6} />
                      <Skeleton width='100%' height='40px' rounded={6} />
                      <Skeleton width='100%' height='40px' rounded={6} />
                    </VStack>
                  ) : (
                    <Timeline>
                      {TIMELINE.slice(0, 4).map(event => {
                        const Icon = INDICATOR[event.kind].icon;
                        return (
                          <TimelineItem key={event.id}>
                            <TimelineConnector>
                              <TimelineIndicator color={INDICATOR[event.kind].color}>
                                <Icon />
                              </TimelineIndicator>
                              <TimelineSeparator />
                            </TimelineConnector>
                            <TimelineContent>
                              <TimelineTitle>{event.title}</TimelineTitle>
                              <HStack gap={4}>
                                <FormatDateTime
                                  value={event.at}
                                  format='datetime'
                                  layout='inline'
                                />
                                <Text size='sm' color='secondary'>
                                  · {event.actor}
                                </Text>
                              </HStack>
                            </TimelineContent>
                          </TimelineItem>
                        );
                      })}
                    </Timeline>
                  )}
                </CardContent>
              </Card>
            </div>
          </TabsContent>

          <TabsContent value='timeline'>
            <div className='max-w-[720px]'>
              <Timeline data-testid='incident-timeline'>
                {TIMELINE.map(event => {
                  const Icon = INDICATOR[event.kind].icon;
                  return (
                    <TimelineItem key={event.id}>
                      <TimelineConnector>
                        <TimelineIndicator color={INDICATOR[event.kind].color}>
                          <Icon />
                        </TimelineIndicator>
                        <TimelineSeparator />
                      </TimelineConnector>
                      <TimelineContent>
                        <TimelineTitle>{event.title}</TimelineTitle>
                        <TimelineDescription>{event.description}</TimelineDescription>
                        <HStack gap={4}>
                          <FormatDateTime value={event.at} format='datetime' layout='inline' />
                          <Text size='sm' color='secondary'>
                            · {event.actor}
                          </Text>
                        </HStack>
                      </TimelineContent>
                    </TimelineItem>
                  );
                })}
              </Timeline>
            </div>
          </TabsContent>

          <TabsContent value='events'>
            <Table
              aria-label='Related events'
              data={RELATED_EVENTS}
              columns={eventColumns}
              getRowId={getItemId}
              isLoading={isLoading}
              data-testid='incident-events-table'
            />
          </TabsContent>

          <TabsContent value='comments'>
            <VStack gap={24} className='max-w-[720px]' data-testid='incident-comments'>
              {comments.map(comment => (
                <VStack key={comment.id} gap={8}>
                  <HStack justify='between'>
                    <Avatar size='md'>
                      <AvatarFallback name={comment.author} />
                      <AvatarContent>
                        <AvatarName>{comment.author}</AvatarName>
                        <AvatarDescription>{comment.role}</AvatarDescription>
                      </AvatarContent>
                    </Avatar>
                    <FormatDateTime value={comment.at} format='datetime' layout='inline' />
                  </HStack>
                  <Text size='sm'>{comment.body}</Text>
                </VStack>
              ))}
              <VStack gap={12}>
                <Field>
                  <FieldLabel>Add a comment</FieldLabel>
                  <Textarea
                    value={draft}
                    onChange={handleDraftChange}
                    minRows={3}
                    placeholder='Share findings or next steps with the team'
                    data-testid='incident-comment-input'
                  />
                </Field>
                <HStack justify='end'>
                  <Button size='medium' disabled={!draft.trim()} onClick={handleAddComment}>
                    <MessageSquare />
                    Comment
                  </Button>
                </HStack>
              </VStack>
            </VStack>
          </TabsContent>
        </PageContent>
      </Tabs>

      <Dialog
        width={400}
        open={dialogOpen}
        onOpenChange={handleDialogOpenChange}
        data-testid='false-positive-dialog'
      >
        <DialogContent>
          <DialogHeader>
            <DialogTitle>Mark as false positive?</DialogTitle>
            <DialogDescription>
              This closes {INCIDENT.id} and adds a rule exception for {INCIDENT.method}{' '}
              {INCIDENT.path}, so matching requests stop raising incidents. You can reopen it later.
            </DialogDescription>
          </DialogHeader>
          <DialogFooter>
            <DialogClose asChild>
              <Button variant='ghost' color='neutral'>
                Cancel
              </Button>
            </DialogClose>
            <Button
              loading={pending}
              onClick={handleConfirmFalsePositive}
              data-testid='false-positive-confirm'
            >
              Mark as false positive
            </Button>
          </DialogFooter>
        </DialogContent>
      </Dialog>
    </Page>
  );
};
```

The Timeline tab with every entry.

The Timeline tab: every entry newest first, each with an indicator colored by who acted
(detection, system, person, resolution), a description, the time and the actor.

```tsx
import { type ChangeEvent, useState } from 'react';
import { Alert, AlertContent, AlertControls, AlertDescription, AlertIcon, AlertTitle } from '@wallarm-org/design-system/Alert';
import { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';
import { Avatar, AvatarContent, AvatarDescription, AvatarFallback, AvatarName } from '@wallarm-org/design-system/Avatar';
import { Badge } from '@wallarm-org/design-system/Badge';
import { Button } from '@wallarm-org/design-system/Button';
import { Card, CardContent, CardHeader, CardTitle } from '@wallarm-org/design-system/Card';
import { Code } from '@wallarm-org/design-system/Code';
import { CodeSnippetActions, CodeSnippetCode, CodeSnippetContent, CodeSnippetCopyButton, CodeSnippetHeader, CodeSnippetLineNumbers, CodeSnippetRoot, CodeSnippetTitle, CodeSnippetWrapButton, InlineCodeSnippet } from '@wallarm-org/design-system/CodeSnippet';
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@wallarm-org/design-system/Dialog';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemIcon, DropdownMenuItemText, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';
import { Field, FieldLabel } from '@wallarm-org/design-system/Field';
import { FormatDateTime } from '@wallarm-org/design-system/FormatDateTime';
import { FormatNumber } from '@wallarm-org/design-system/FormatNumber';
import { Heading } from '@wallarm-org/design-system/Heading';
import { HttpMethod } from '@wallarm-org/design-system/HttpMethod';
import { ChevronDown, CircleCheck, Copy, Download, Ellipsis, ExternalLink, Flag, MessageSquare, ShieldAlert, ShieldCheck } from '@wallarm-org/design-system/icons';
import { Ip, IpAddress, IpCountry } from '@wallarm-org/design-system/Ip';
import { NumericBadge } from '@wallarm-org/design-system/NumericBadge';
import { Page, PageActions, PageContent, PageHeader, PageHeaderGroup, PageTitle } from '@wallarm-org/design-system/Page';
import { ResponseCode } from '@wallarm-org/design-system/ResponseCode';
import { Skeleton } from '@wallarm-org/design-system/Skeleton';
import { SplitButton } from '@wallarm-org/design-system/SplitButton';
import { HStack, VStack } from '@wallarm-org/design-system/Stack';
import { type TableCellContext, type TableColumnDef, type TableRow, Table } from '@wallarm-org/design-system/Table';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@wallarm-org/design-system/Tabs';
import { Text } from '@wallarm-org/design-system/Text';
import { Textarea } from '@wallarm-org/design-system/Textarea';
import { Timeline, TimelineConnector, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, TimelineSeparator, TimelineTitle } from '@wallarm-org/design-system/Timeline';
import { useToast } from '@wallarm-org/design-system/Toast';

export const TimelineTab = ({
  initialTab = 'overview',
  isLoading = false,
}) => {
  const toast = useToast();
  const [tab, setTab] = useState(initialTab);
  const [status, setStatus] = useState<IncidentStatus>('open');
  const [assignee, setAssignee] = useState('Daniel Okafor');
  const [dialogOpen, setDialogOpen] = useState(false);
  const [pending, setPending] = useState(false);
  const [comments, setComments] = useState(COMMENTS);
  const [draft, setDraft] = useState('');

  const renderRequest = ({ row }: TableCellContext<RelatedEvent, unknown>) => (
    <HStack gap={8}>
      <HttpMethod method={row.original.method} />
      <Text size='sm' truncate>
        {row.original.path}
      </Text>
    </HStack>
  );
  const renderSource = ({ row }: TableCellContext<RelatedEvent, unknown>) => (
    <Ip>
      <IpCountry code={row.original.country} />
      <IpAddress>{row.original.ip}</IpAddress>
    </Ip>
  );
  const renderPayload = ({ row }: TableCellContext<RelatedEvent, unknown>) => (
    <Code size='m' truncate>
      {row.original.payload}
    </Code>
  );
  const renderResponse = ({ row }: TableCellContext<RelatedEvent, unknown>) => (
    <ResponseCode code={row.original.responseCode} />
  );
  const renderAction = ({ row }: TableCellContext<RelatedEvent, unknown>) => (
    <Badge variant='dotted' type='secondary' color={ACTION[row.original.action].color}>
      {ACTION[row.original.action].label}
    </Badge>
  );
  const renderTime = ({ row }: TableCellContext<RelatedEvent, unknown>) => (
    <FormatDateTime value={row.original.at} format='datetime' layout='inline' />
  );

  const renderEventMenu = (row: TableRow<RelatedEvent>) => {
    const event = row.original;
    const handleOpen = () => onOpenRequest(event.id);
    const handleCopyId = () => onCopyRequestId(event.id);

    return (
      <DropdownMenu data-testid='incident-event-menu'>
        <DropdownMenuTrigger asChild>
          <Button
            variant='ghost'
            color='neutral'
            size='small'
            aria-label={`Actions for request ${event.id}`}
          >
            <Ellipsis />
          </Button>
        </DropdownMenuTrigger>
        <DropdownMenuContent>
          <DropdownMenuItem onSelect={handleOpen}>
            <DropdownMenuItemText>Open request</DropdownMenuItemText>
          </DropdownMenuItem>
          <DropdownMenuItem onSelect={handleCopyId}>
            <DropdownMenuItemText>Copy request ID</DropdownMenuItemText>
          </DropdownMenuItem>
        </DropdownMenuContent>
      </DropdownMenu>
    );
  };

  const eventColumns: TableColumnDef<RelatedEvent>[] = [
    {
      id: 'request',
      header: 'Request',
      size: 320,
      cell: renderRequest,
      meta: { renderMenuAction: renderEventMenu },
    },
    { accessorKey: 'ip', header: 'Source', size: 200, cell: renderSource },
    { accessorKey: 'payload', header: 'Payload', size: 360, cell: renderPayload },
    { accessorKey: 'responseCode', header: 'Response', size: 120, cell: renderResponse },
    { accessorKey: 'action', header: 'Result', size: 140, cell: renderAction },
    { accessorKey: 'at', header: 'Time', size: 200, cell: renderTime },
  ];

  const isOpen = status === 'open';

  const handleResolve = () => {
    onResolve(INCIDENT.id);
    setStatus(isOpen ? 'resolved' : 'open');
    toast.create({
      id: 'incident-resolution',
      title: isOpen ? 'Incident resolved' : 'Incident reopened',
      type: 'default',
    });
  };
  const handleOpenFalsePositive = () => setDialogOpen(true);
  const handleAcceptRisk = () => onAcceptRisk(INCIDENT.id);
  const handleCreateTicket = () => onCreateTicket(INCIDENT.id);
  const handleCopyLink = () => onCopyLink(INCIDENT.id);
  const handleExport = () => onExport(INCIDENT.id);
  const handleAssigneeChange = ({ value }: { value: string }) => {
    onAssign(value);
    setAssignee(value);
  };
  const handleShowTimeline = () => setTab('timeline');
  const handleShowEvents = () => setTab('events');
  const handleDialogOpenChange = (next: boolean) => {
    if (!pending) setDialogOpen(next);
  };
  const handleConfirmFalsePositive = async () => {
    setPending(true);
    try {
      await markFalsePositive(INCIDENT.id);
      setStatus('false-positive');
      setDialogOpen(false);
      toast.create({ title: 'Marked as false positive', type: 'default' });
    } catch {
      toast.create({ title: "Couldn't mark as false positive", type: 'error' });
    } finally {
      setPending(false);
    }
  };
  const handleDraftChange = (event: ChangeEvent<HTMLTextAreaElement>) =>
    setDraft(event.target.value);
  const handleAddComment = () => {
    const body = draft.trim();
    if (!body) return;
    onAddComment(body);
    setComments(prev => [
      ...prev,
      {
        id: `c-${prev.length + 1}`,
        author: assignee,
        role: 'Security analyst',
        body,
        at: new Date().toISOString(),
      },
    ]);
    setDraft('');
  };

  return (
    <Page name='incident-detail' fullSize fixedHeight data-testid='incident-page'>
      <PageHeader>
        <PageHeaderGroup className='flex-1 gap-6'>
          {isLoading ? (
            <>
              <Skeleton width='480px' height='28px' rounded={6} />
              <Skeleton width='320px' height='20px' rounded={6} />
            </>
          ) : (
            <>
              <PageTitle>{INCIDENT.title}</PageTitle>
              <HStack gap={8} data-testid='incident-meta'>
                <Badge color='red' type='solid'>
                  <ShieldAlert />
                  Critical
                </Badge>
                <Badge
                  variant='dotted'
                  type='secondary'
                  color={STATUS[status].color}
                  data-testid='incident-status'
                >
                  {STATUS[status].label}
                </Badge>
                <Text size='sm' color='secondary'>
                  {INCIDENT.id} · {INCIDENT.host} · opened
                </Text>
                <FormatDateTime value={INCIDENT.firstSeen} format='datetime' layout='inline' />
              </HStack>
            </>
          )}
        </PageHeaderGroup>
        <PageActions>
          <DropdownMenu>
            <DropdownMenuTrigger asChild>
              <Button
                variant='outline'
                color='neutral'
                size='medium'
                disabled={isLoading}
                data-testid='incident-assignee'
              >
                <Avatar size='sm'>
                  <AvatarFallback name={assignee} />
                </Avatar>
                {assignee}
                <ChevronDown />
              </Button>
            </DropdownMenuTrigger>
            <DropdownMenuContent>
              <DropdownMenuLabel>Assignee</DropdownMenuLabel>
              <DropdownMenuRadioGroup value={assignee} onValueChange={handleAssigneeChange}>
                {ANALYSTS.map(name => (
                  <DropdownMenuRadioItem key={name} value={name}>
                    {name}
                  </DropdownMenuRadioItem>
                ))}
              </DropdownMenuRadioGroup>
            </DropdownMenuContent>
          </DropdownMenu>

          <DropdownMenu>
            <SplitButton data-testid='incident-resolve'>
              <Button
                size='medium'
                disabled={isLoading}
                onClick={handleResolve}
                data-testid='incident-resolve-primary'
              >
                {isOpen ? <CircleCheck /> : null}
                {isOpen ? 'Resolve' : 'Reopen'}
              </Button>
              <DropdownMenuTrigger asChild>
                <Button
                  size='medium'
                  disabled={isLoading || !isOpen}
                  aria-label='More ways to resolve'
                  data-testid='incident-resolve-menu'
                >
                  <ChevronDown />
                </Button>
              </DropdownMenuTrigger>
            </SplitButton>
            <DropdownMenuContent>
              <DropdownMenuItem
                onSelect={handleOpenFalsePositive}
                data-testid='incident-false-positive'
              >
                <DropdownMenuItemIcon>
                  <Flag />
                </DropdownMenuItemIcon>
                <DropdownMenuItemText>Mark as false positive</DropdownMenuItemText>
              </DropdownMenuItem>
              <DropdownMenuItem onSelect={handleAcceptRisk}>
                <DropdownMenuItemIcon>
                  <ShieldCheck />
                </DropdownMenuItemIcon>
                <DropdownMenuItemText>Accept risk</DropdownMenuItemText>
              </DropdownMenuItem>
              <DropdownMenuItem onSelect={handleCreateTicket}>
                <DropdownMenuItemIcon>
                  <ExternalLink />
                </DropdownMenuItemIcon>
                <DropdownMenuItemText>Create Jira ticket</DropdownMenuItemText>
              </DropdownMenuItem>
            </DropdownMenuContent>
          </DropdownMenu>

          <DropdownMenu>
            <DropdownMenuTrigger asChild>
              <Button
                variant='ghost'
                color='neutral'
                size='medium'
                disabled={isLoading}
                aria-label='More actions'
              >
                <Ellipsis />
              </Button>
            </DropdownMenuTrigger>
            <DropdownMenuContent>
              <DropdownMenuItem onSelect={handleCopyLink}>
                <DropdownMenuItemIcon>
                  <Copy />
                </DropdownMenuItemIcon>
                <DropdownMenuItemText>Copy link</DropdownMenuItemText>
              </DropdownMenuItem>
              <DropdownMenuSeparator />
              <DropdownMenuItem onSelect={handleExport}>
                <DropdownMenuItemIcon>
                  <Download />
                </DropdownMenuItemIcon>
                <DropdownMenuItemText>Export report</DropdownMenuItemText>
              </DropdownMenuItem>
            </DropdownMenuContent>
          </DropdownMenu>
        </PageActions>
      </PageHeader>

      <Tabs
        value={tab}
        onChange={setTab}
        className='flex min-h-0 flex-1 flex-col'
        data-testid='incident-tabs'
      >
        <TabsList>
          <TabsTrigger value='overview'>Overview</TabsTrigger>
          <TabsTrigger value='timeline'>
            Timeline {!isLoading && <NumericBadge>{TIMELINE.length}</NumericBadge>}
          </TabsTrigger>
          <TabsTrigger value='events' data-testid='incident-tab-events'>
            Related events {!isLoading && <NumericBadge>{RELATED_EVENTS.length}</NumericBadge>}
          </TabsTrigger>
          <TabsTrigger value='comments'>
            Comments {!isLoading && <NumericBadge>{comments.length}</NumericBadge>}
          </TabsTrigger>
        </TabsList>

        <PageContent>
          <TabsContent value='overview'>
            <div className='grid grid-cols-[minmax(0,1fr)_400px] items-start gap-24'>
              <VStack gap={24}>
                {isOpen && !isLoading && (
                  <Alert color='destructive' data-testid='incident-alert'>
                    <AlertIcon />
                    <AlertContent>
                      <AlertTitle>Attack still in progress</AlertTitle>
                      <AlertDescription>
                        412 requests a minute from 4 addresses. Blocking mode is on for{' '}
                        {INCIDENT.host}, so none reach the application.
                      </AlertDescription>
                    </AlertContent>
                    <AlertControls>
                      <Button
                        variant='secondary'
                        color='neutral'
                        size='small'
                        onClick={handleShowEvents}
                      >
                        View related events
                      </Button>
                    </AlertControls>
                  </Alert>
                )}

                <VStack gap={12}>
                  <Heading as='h2' size='md' weight='medium'>
                    Details
                  </Heading>
                  <div
                    className='grid grid-cols-2 gap-x-8 gap-y-16 rounded-8 border border-border-primary-light p-16'
                    data-testid='incident-attributes'
                  >
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Endpoint</AttributeLabel>
                      <AttributeValue>
                        <HStack gap={6}>
                          <HttpMethod method={INCIDENT.method} />
                          <InlineCodeSnippet code={INCIDENT.path} size='md' />
                        </HStack>
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Host</AttributeLabel>
                      <AttributeValue>
                        <InlineCodeSnippet code={INCIDENT.host} size='md' />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Attack type</AttributeLabel>
                      <AttributeValue>
                        <HStack gap={4}>
                          <Badge type='secondary' color='slate' size='medium'>
                            SQL injection
                          </Badge>
                          <Badge type='secondary' color='slate' size='medium'>
                            CWE-89
                          </Badge>
                        </HStack>
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Parameter</AttributeLabel>
                      <AttributeValue>
                        <InlineCodeSnippet code={INCIDENT.parameter} size='md' />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Detection rule</AttributeLabel>
                      <AttributeValue>
                        <InlineCodeSnippet code={INCIDENT.rule} size='md' />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Requests</AttributeLabel>
                      <AttributeValue>
                        <FormatNumber value={INCIDENT.requests} notation='standard' />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Blocked</AttributeLabel>
                      <AttributeValue>
                        <FormatNumber value={INCIDENT.blockedShare} type='percent' decimals={1} />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>First seen</AttributeLabel>
                      <AttributeValue>
                        <FormatDateTime
                          value={INCIDENT.firstSeen}
                          format='datetime'
                          layout='inline'
                        />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Last seen</AttributeLabel>
                      <AttributeValue>
                        <FormatDateTime
                          value={INCIDENT.lastSeen}
                          format='datetime'
                          layout='inline'
                        />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading} isEmpty={!isLoading}>
                      <AttributeLabel>Ticket</AttributeLabel>
                      <AttributeValue />
                    </Attribute>
                    <Attribute loading={isLoading} className='col-span-2'>
                      <AttributeLabel>Source IPs</AttributeLabel>
                      <AttributeValue>
                        <HStack gap={8}>
                          {INCIDENT.sourceIps.map(source => (
                            <Ip key={source.ip}>
                              <IpCountry code={source.country} />
                              <IpAddress>{source.ip}</IpAddress>
                            </Ip>
                          ))}
                        </HStack>
                      </AttributeValue>
                    </Attribute>
                  </div>
                </VStack>

                <VStack gap={12}>
                  <Heading as='h2' size='md' weight='medium'>
                    Description
                  </Heading>
                  {isLoading ? (
                    <VStack gap={8}>
                      <Skeleton width='100%' height='16px' rounded={4} />
                      <Skeleton width='72%' height='16px' rounded={4} />
                    </VStack>
                  ) : (
                    <Text size='sm'>
                      An automated scanner is sending SQL injection payloads in the customer_id
                      filter of the order search endpoint. Early requests returned 500 while the
                      host was in monitoring mode, which suggests the value reaches the database
                      unescaped. Since blocking was enabled every request is rejected, but the
                      parameter should be fixed at the source.
                    </Text>
                  )}
                </VStack>

                <VStack gap={12}>
                  <Heading as='h2' size='md' weight='medium'>
                    Sample request
                  </Heading>
                  {isLoading ? (
                    <Skeleton width='100%' height='160px' rounded={8} />
                  ) : (
                    <CodeSnippetRoot code={SAMPLE_REQUEST} language='text'>
                      <CodeSnippetHeader>
                        <CodeSnippetTitle>Request r-90412 · blocked</CodeSnippetTitle>
                        <CodeSnippetActions>
                          <CodeSnippetWrapButton />
                          <CodeSnippetCopyButton />
                        </CodeSnippetActions>
                      </CodeSnippetHeader>
                      <CodeSnippetContent>
                        <CodeSnippetLineNumbers />
                        <CodeSnippetCode />
                      </CodeSnippetContent>
                    </CodeSnippetRoot>
                  )}
                </VStack>
              </VStack>

              <Card className='h-auto' data-testid='incident-latest-activity'>
                <CardHeader>
                  <CardTitle>Latest activity</CardTitle>
                  <Button
                    variant='ghost'
                    color='neutral'
                    size='small'
                    disabled={isLoading}
                    onClick={handleShowTimeline}
                  >
                    View timeline
                  </Button>
                </CardHeader>
                <CardContent>
                  {isLoading ? (
                    <VStack gap={16}>
                      <Skeleton width='100%' height='40px' rounded={6} />
                      <Skeleton width='100%' height='40px' rounded={6} />
                      <Skeleton width='100%' height='40px' rounded={6} />
                    </VStack>
                  ) : (
                    <Timeline>
                      {TIMELINE.slice(0, 4).map(event => {
                        const Icon = INDICATOR[event.kind].icon;
                        return (
                          <TimelineItem key={event.id}>
                            <TimelineConnector>
                              <TimelineIndicator color={INDICATOR[event.kind].color}>
                                <Icon />
                              </TimelineIndicator>
                              <TimelineSeparator />
                            </TimelineConnector>
                            <TimelineContent>
                              <TimelineTitle>{event.title}</TimelineTitle>
                              <HStack gap={4}>
                                <FormatDateTime
                                  value={event.at}
                                  format='datetime'
                                  layout='inline'
                                />
                                <Text size='sm' color='secondary'>
                                  · {event.actor}
                                </Text>
                              </HStack>
                            </TimelineContent>
                          </TimelineItem>
                        );
                      })}
                    </Timeline>
                  )}
                </CardContent>
              </Card>
            </div>
          </TabsContent>

          <TabsContent value='timeline'>
            <div className='max-w-[720px]'>
              <Timeline data-testid='incident-timeline'>
                {TIMELINE.map(event => {
                  const Icon = INDICATOR[event.kind].icon;
                  return (
                    <TimelineItem key={event.id}>
                      <TimelineConnector>
                        <TimelineIndicator color={INDICATOR[event.kind].color}>
                          <Icon />
                        </TimelineIndicator>
                        <TimelineSeparator />
                      </TimelineConnector>
                      <TimelineContent>
                        <TimelineTitle>{event.title}</TimelineTitle>
                        <TimelineDescription>{event.description}</TimelineDescription>
                        <HStack gap={4}>
                          <FormatDateTime value={event.at} format='datetime' layout='inline' />
                          <Text size='sm' color='secondary'>
                            · {event.actor}
                          </Text>
                        </HStack>
                      </TimelineContent>
                    </TimelineItem>
                  );
                })}
              </Timeline>
            </div>
          </TabsContent>

          <TabsContent value='events'>
            <Table
              aria-label='Related events'
              data={RELATED_EVENTS}
              columns={eventColumns}
              getRowId={getItemId}
              isLoading={isLoading}
              data-testid='incident-events-table'
            />
          </TabsContent>

          <TabsContent value='comments'>
            <VStack gap={24} className='max-w-[720px]' data-testid='incident-comments'>
              {comments.map(comment => (
                <VStack key={comment.id} gap={8}>
                  <HStack justify='between'>
                    <Avatar size='md'>
                      <AvatarFallback name={comment.author} />
                      <AvatarContent>
                        <AvatarName>{comment.author}</AvatarName>
                        <AvatarDescription>{comment.role}</AvatarDescription>
                      </AvatarContent>
                    </Avatar>
                    <FormatDateTime value={comment.at} format='datetime' layout='inline' />
                  </HStack>
                  <Text size='sm'>{comment.body}</Text>
                </VStack>
              ))}
              <VStack gap={12}>
                <Field>
                  <FieldLabel>Add a comment</FieldLabel>
                  <Textarea
                    value={draft}
                    onChange={handleDraftChange}
                    minRows={3}
                    placeholder='Share findings or next steps with the team'
                    data-testid='incident-comment-input'
                  />
                </Field>
                <HStack justify='end'>
                  <Button size='medium' disabled={!draft.trim()} onClick={handleAddComment}>
                    <MessageSquare />
                    Comment
                  </Button>
                </HStack>
              </VStack>
            </VStack>
          </TabsContent>
        </PageContent>
      </Tabs>

      <Dialog
        width={400}
        open={dialogOpen}
        onOpenChange={handleDialogOpenChange}
        data-testid='false-positive-dialog'
      >
        <DialogContent>
          <DialogHeader>
            <DialogTitle>Mark as false positive?</DialogTitle>
            <DialogDescription>
              This closes {INCIDENT.id} and adds a rule exception for {INCIDENT.method}{' '}
              {INCIDENT.path}, so matching requests stop raising incidents. You can reopen it later.
            </DialogDescription>
          </DialogHeader>
          <DialogFooter>
            <DialogClose asChild>
              <Button variant='ghost' color='neutral'>
                Cancel
              </Button>
            </DialogClose>
            <Button
              loading={pending}
              onClick={handleConfirmFalsePositive}
              data-testid='false-positive-confirm'
            >
              Mark as false positive
            </Button>
          </DialogFooter>
        </DialogContent>
      </Dialog>
    </Page>
  );
};
```

First load with skeletons.

First load: header skeletons, disabled actions, tabs without counts, `Attribute loading`
rows and skeleton blocks where the description, request and activity card will land.

```tsx
import { type ChangeEvent, useState } from 'react';
import { Alert, AlertContent, AlertControls, AlertDescription, AlertIcon, AlertTitle } from '@wallarm-org/design-system/Alert';
import { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';
import { Avatar, AvatarContent, AvatarDescription, AvatarFallback, AvatarName } from '@wallarm-org/design-system/Avatar';
import { Badge } from '@wallarm-org/design-system/Badge';
import { Button } from '@wallarm-org/design-system/Button';
import { Card, CardContent, CardHeader, CardTitle } from '@wallarm-org/design-system/Card';
import { Code } from '@wallarm-org/design-system/Code';
import { CodeSnippetActions, CodeSnippetCode, CodeSnippetContent, CodeSnippetCopyButton, CodeSnippetHeader, CodeSnippetLineNumbers, CodeSnippetRoot, CodeSnippetTitle, CodeSnippetWrapButton, InlineCodeSnippet } from '@wallarm-org/design-system/CodeSnippet';
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@wallarm-org/design-system/Dialog';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemIcon, DropdownMenuItemText, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';
import { Field, FieldLabel } from '@wallarm-org/design-system/Field';
import { FormatDateTime } from '@wallarm-org/design-system/FormatDateTime';
import { FormatNumber } from '@wallarm-org/design-system/FormatNumber';
import { Heading } from '@wallarm-org/design-system/Heading';
import { HttpMethod } from '@wallarm-org/design-system/HttpMethod';
import { ChevronDown, CircleCheck, Copy, Download, Ellipsis, ExternalLink, Flag, MessageSquare, ShieldAlert, ShieldCheck } from '@wallarm-org/design-system/icons';
import { Ip, IpAddress, IpCountry } from '@wallarm-org/design-system/Ip';
import { NumericBadge } from '@wallarm-org/design-system/NumericBadge';
import { Page, PageActions, PageContent, PageHeader, PageHeaderGroup, PageTitle } from '@wallarm-org/design-system/Page';
import { ResponseCode } from '@wallarm-org/design-system/ResponseCode';
import { Skeleton } from '@wallarm-org/design-system/Skeleton';
import { SplitButton } from '@wallarm-org/design-system/SplitButton';
import { HStack, VStack } from '@wallarm-org/design-system/Stack';
import { type TableCellContext, type TableColumnDef, type TableRow, Table } from '@wallarm-org/design-system/Table';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@wallarm-org/design-system/Tabs';
import { Text } from '@wallarm-org/design-system/Text';
import { Textarea } from '@wallarm-org/design-system/Textarea';
import { Timeline, TimelineConnector, TimelineContent, TimelineDescription, TimelineIndicator, TimelineItem, TimelineSeparator, TimelineTitle } from '@wallarm-org/design-system/Timeline';
import { useToast } from '@wallarm-org/design-system/Toast';

export const Loading = ({
  initialTab = 'overview',
  isLoading = false,
}) => {
  const toast = useToast();
  const [tab, setTab] = useState(initialTab);
  const [status, setStatus] = useState<IncidentStatus>('open');
  const [assignee, setAssignee] = useState('Daniel Okafor');
  const [dialogOpen, setDialogOpen] = useState(false);
  const [pending, setPending] = useState(false);
  const [comments, setComments] = useState(COMMENTS);
  const [draft, setDraft] = useState('');

  const renderRequest = ({ row }: TableCellContext<RelatedEvent, unknown>) => (
    <HStack gap={8}>
      <HttpMethod method={row.original.method} />
      <Text size='sm' truncate>
        {row.original.path}
      </Text>
    </HStack>
  );
  const renderSource = ({ row }: TableCellContext<RelatedEvent, unknown>) => (
    <Ip>
      <IpCountry code={row.original.country} />
      <IpAddress>{row.original.ip}</IpAddress>
    </Ip>
  );
  const renderPayload = ({ row }: TableCellContext<RelatedEvent, unknown>) => (
    <Code size='m' truncate>
      {row.original.payload}
    </Code>
  );
  const renderResponse = ({ row }: TableCellContext<RelatedEvent, unknown>) => (
    <ResponseCode code={row.original.responseCode} />
  );
  const renderAction = ({ row }: TableCellContext<RelatedEvent, unknown>) => (
    <Badge variant='dotted' type='secondary' color={ACTION[row.original.action].color}>
      {ACTION[row.original.action].label}
    </Badge>
  );
  const renderTime = ({ row }: TableCellContext<RelatedEvent, unknown>) => (
    <FormatDateTime value={row.original.at} format='datetime' layout='inline' />
  );

  const renderEventMenu = (row: TableRow<RelatedEvent>) => {
    const event = row.original;
    const handleOpen = () => onOpenRequest(event.id);
    const handleCopyId = () => onCopyRequestId(event.id);

    return (
      <DropdownMenu data-testid='incident-event-menu'>
        <DropdownMenuTrigger asChild>
          <Button
            variant='ghost'
            color='neutral'
            size='small'
            aria-label={`Actions for request ${event.id}`}
          >
            <Ellipsis />
          </Button>
        </DropdownMenuTrigger>
        <DropdownMenuContent>
          <DropdownMenuItem onSelect={handleOpen}>
            <DropdownMenuItemText>Open request</DropdownMenuItemText>
          </DropdownMenuItem>
          <DropdownMenuItem onSelect={handleCopyId}>
            <DropdownMenuItemText>Copy request ID</DropdownMenuItemText>
          </DropdownMenuItem>
        </DropdownMenuContent>
      </DropdownMenu>
    );
  };

  const eventColumns: TableColumnDef<RelatedEvent>[] = [
    {
      id: 'request',
      header: 'Request',
      size: 320,
      cell: renderRequest,
      meta: { renderMenuAction: renderEventMenu },
    },
    { accessorKey: 'ip', header: 'Source', size: 200, cell: renderSource },
    { accessorKey: 'payload', header: 'Payload', size: 360, cell: renderPayload },
    { accessorKey: 'responseCode', header: 'Response', size: 120, cell: renderResponse },
    { accessorKey: 'action', header: 'Result', size: 140, cell: renderAction },
    { accessorKey: 'at', header: 'Time', size: 200, cell: renderTime },
  ];

  const isOpen = status === 'open';

  const handleResolve = () => {
    onResolve(INCIDENT.id);
    setStatus(isOpen ? 'resolved' : 'open');
    toast.create({
      id: 'incident-resolution',
      title: isOpen ? 'Incident resolved' : 'Incident reopened',
      type: 'default',
    });
  };
  const handleOpenFalsePositive = () => setDialogOpen(true);
  const handleAcceptRisk = () => onAcceptRisk(INCIDENT.id);
  const handleCreateTicket = () => onCreateTicket(INCIDENT.id);
  const handleCopyLink = () => onCopyLink(INCIDENT.id);
  const handleExport = () => onExport(INCIDENT.id);
  const handleAssigneeChange = ({ value }: { value: string }) => {
    onAssign(value);
    setAssignee(value);
  };
  const handleShowTimeline = () => setTab('timeline');
  const handleShowEvents = () => setTab('events');
  const handleDialogOpenChange = (next: boolean) => {
    if (!pending) setDialogOpen(next);
  };
  const handleConfirmFalsePositive = async () => {
    setPending(true);
    try {
      await markFalsePositive(INCIDENT.id);
      setStatus('false-positive');
      setDialogOpen(false);
      toast.create({ title: 'Marked as false positive', type: 'default' });
    } catch {
      toast.create({ title: "Couldn't mark as false positive", type: 'error' });
    } finally {
      setPending(false);
    }
  };
  const handleDraftChange = (event: ChangeEvent<HTMLTextAreaElement>) =>
    setDraft(event.target.value);
  const handleAddComment = () => {
    const body = draft.trim();
    if (!body) return;
    onAddComment(body);
    setComments(prev => [
      ...prev,
      {
        id: `c-${prev.length + 1}`,
        author: assignee,
        role: 'Security analyst',
        body,
        at: new Date().toISOString(),
      },
    ]);
    setDraft('');
  };

  return (
    <Page name='incident-detail' fullSize fixedHeight data-testid='incident-page'>
      <PageHeader>
        <PageHeaderGroup className='flex-1 gap-6'>
          {isLoading ? (
            <>
              <Skeleton width='480px' height='28px' rounded={6} />
              <Skeleton width='320px' height='20px' rounded={6} />
            </>
          ) : (
            <>
              <PageTitle>{INCIDENT.title}</PageTitle>
              <HStack gap={8} data-testid='incident-meta'>
                <Badge color='red' type='solid'>
                  <ShieldAlert />
                  Critical
                </Badge>
                <Badge
                  variant='dotted'
                  type='secondary'
                  color={STATUS[status].color}
                  data-testid='incident-status'
                >
                  {STATUS[status].label}
                </Badge>
                <Text size='sm' color='secondary'>
                  {INCIDENT.id} · {INCIDENT.host} · opened
                </Text>
                <FormatDateTime value={INCIDENT.firstSeen} format='datetime' layout='inline' />
              </HStack>
            </>
          )}
        </PageHeaderGroup>
        <PageActions>
          <DropdownMenu>
            <DropdownMenuTrigger asChild>
              <Button
                variant='outline'
                color='neutral'
                size='medium'
                disabled={isLoading}
                data-testid='incident-assignee'
              >
                <Avatar size='sm'>
                  <AvatarFallback name={assignee} />
                </Avatar>
                {assignee}
                <ChevronDown />
              </Button>
            </DropdownMenuTrigger>
            <DropdownMenuContent>
              <DropdownMenuLabel>Assignee</DropdownMenuLabel>
              <DropdownMenuRadioGroup value={assignee} onValueChange={handleAssigneeChange}>
                {ANALYSTS.map(name => (
                  <DropdownMenuRadioItem key={name} value={name}>
                    {name}
                  </DropdownMenuRadioItem>
                ))}
              </DropdownMenuRadioGroup>
            </DropdownMenuContent>
          </DropdownMenu>

          <DropdownMenu>
            <SplitButton data-testid='incident-resolve'>
              <Button
                size='medium'
                disabled={isLoading}
                onClick={handleResolve}
                data-testid='incident-resolve-primary'
              >
                {isOpen ? <CircleCheck /> : null}
                {isOpen ? 'Resolve' : 'Reopen'}
              </Button>
              <DropdownMenuTrigger asChild>
                <Button
                  size='medium'
                  disabled={isLoading || !isOpen}
                  aria-label='More ways to resolve'
                  data-testid='incident-resolve-menu'
                >
                  <ChevronDown />
                </Button>
              </DropdownMenuTrigger>
            </SplitButton>
            <DropdownMenuContent>
              <DropdownMenuItem
                onSelect={handleOpenFalsePositive}
                data-testid='incident-false-positive'
              >
                <DropdownMenuItemIcon>
                  <Flag />
                </DropdownMenuItemIcon>
                <DropdownMenuItemText>Mark as false positive</DropdownMenuItemText>
              </DropdownMenuItem>
              <DropdownMenuItem onSelect={handleAcceptRisk}>
                <DropdownMenuItemIcon>
                  <ShieldCheck />
                </DropdownMenuItemIcon>
                <DropdownMenuItemText>Accept risk</DropdownMenuItemText>
              </DropdownMenuItem>
              <DropdownMenuItem onSelect={handleCreateTicket}>
                <DropdownMenuItemIcon>
                  <ExternalLink />
                </DropdownMenuItemIcon>
                <DropdownMenuItemText>Create Jira ticket</DropdownMenuItemText>
              </DropdownMenuItem>
            </DropdownMenuContent>
          </DropdownMenu>

          <DropdownMenu>
            <DropdownMenuTrigger asChild>
              <Button
                variant='ghost'
                color='neutral'
                size='medium'
                disabled={isLoading}
                aria-label='More actions'
              >
                <Ellipsis />
              </Button>
            </DropdownMenuTrigger>
            <DropdownMenuContent>
              <DropdownMenuItem onSelect={handleCopyLink}>
                <DropdownMenuItemIcon>
                  <Copy />
                </DropdownMenuItemIcon>
                <DropdownMenuItemText>Copy link</DropdownMenuItemText>
              </DropdownMenuItem>
              <DropdownMenuSeparator />
              <DropdownMenuItem onSelect={handleExport}>
                <DropdownMenuItemIcon>
                  <Download />
                </DropdownMenuItemIcon>
                <DropdownMenuItemText>Export report</DropdownMenuItemText>
              </DropdownMenuItem>
            </DropdownMenuContent>
          </DropdownMenu>
        </PageActions>
      </PageHeader>

      <Tabs
        value={tab}
        onChange={setTab}
        className='flex min-h-0 flex-1 flex-col'
        data-testid='incident-tabs'
      >
        <TabsList>
          <TabsTrigger value='overview'>Overview</TabsTrigger>
          <TabsTrigger value='timeline'>
            Timeline {!isLoading && <NumericBadge>{TIMELINE.length}</NumericBadge>}
          </TabsTrigger>
          <TabsTrigger value='events' data-testid='incident-tab-events'>
            Related events {!isLoading && <NumericBadge>{RELATED_EVENTS.length}</NumericBadge>}
          </TabsTrigger>
          <TabsTrigger value='comments'>
            Comments {!isLoading && <NumericBadge>{comments.length}</NumericBadge>}
          </TabsTrigger>
        </TabsList>

        <PageContent>
          <TabsContent value='overview'>
            <div className='grid grid-cols-[minmax(0,1fr)_400px] items-start gap-24'>
              <VStack gap={24}>
                {isOpen && !isLoading && (
                  <Alert color='destructive' data-testid='incident-alert'>
                    <AlertIcon />
                    <AlertContent>
                      <AlertTitle>Attack still in progress</AlertTitle>
                      <AlertDescription>
                        412 requests a minute from 4 addresses. Blocking mode is on for{' '}
                        {INCIDENT.host}, so none reach the application.
                      </AlertDescription>
                    </AlertContent>
                    <AlertControls>
                      <Button
                        variant='secondary'
                        color='neutral'
                        size='small'
                        onClick={handleShowEvents}
                      >
                        View related events
                      </Button>
                    </AlertControls>
                  </Alert>
                )}

                <VStack gap={12}>
                  <Heading as='h2' size='md' weight='medium'>
                    Details
                  </Heading>
                  <div
                    className='grid grid-cols-2 gap-x-8 gap-y-16 rounded-8 border border-border-primary-light p-16'
                    data-testid='incident-attributes'
                  >
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Endpoint</AttributeLabel>
                      <AttributeValue>
                        <HStack gap={6}>
                          <HttpMethod method={INCIDENT.method} />
                          <InlineCodeSnippet code={INCIDENT.path} size='md' />
                        </HStack>
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Host</AttributeLabel>
                      <AttributeValue>
                        <InlineCodeSnippet code={INCIDENT.host} size='md' />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Attack type</AttributeLabel>
                      <AttributeValue>
                        <HStack gap={4}>
                          <Badge type='secondary' color='slate' size='medium'>
                            SQL injection
                          </Badge>
                          <Badge type='secondary' color='slate' size='medium'>
                            CWE-89
                          </Badge>
                        </HStack>
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Parameter</AttributeLabel>
                      <AttributeValue>
                        <InlineCodeSnippet code={INCIDENT.parameter} size='md' />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Detection rule</AttributeLabel>
                      <AttributeValue>
                        <InlineCodeSnippet code={INCIDENT.rule} size='md' />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Requests</AttributeLabel>
                      <AttributeValue>
                        <FormatNumber value={INCIDENT.requests} notation='standard' />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Blocked</AttributeLabel>
                      <AttributeValue>
                        <FormatNumber value={INCIDENT.blockedShare} type='percent' decimals={1} />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>First seen</AttributeLabel>
                      <AttributeValue>
                        <FormatDateTime
                          value={INCIDENT.firstSeen}
                          format='datetime'
                          layout='inline'
                        />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading}>
                      <AttributeLabel>Last seen</AttributeLabel>
                      <AttributeValue>
                        <FormatDateTime
                          value={INCIDENT.lastSeen}
                          format='datetime'
                          layout='inline'
                        />
                      </AttributeValue>
                    </Attribute>
                    <Attribute loading={isLoading} isEmpty={!isLoading}>
                      <AttributeLabel>Ticket</AttributeLabel>
                      <AttributeValue />
                    </Attribute>
                    <Attribute loading={isLoading} className='col-span-2'>
                      <AttributeLabel>Source IPs</AttributeLabel>
                      <AttributeValue>
                        <HStack gap={8}>
                          {INCIDENT.sourceIps.map(source => (
                            <Ip key={source.ip}>
                              <IpCountry code={source.country} />
                              <IpAddress>{source.ip}</IpAddress>
                            </Ip>
                          ))}
                        </HStack>
                      </AttributeValue>
                    </Attribute>
                  </div>
                </VStack>

                <VStack gap={12}>
                  <Heading as='h2' size='md' weight='medium'>
                    Description
                  </Heading>
                  {isLoading ? (
                    <VStack gap={8}>
                      <Skeleton width='100%' height='16px' rounded={4} />
                      <Skeleton width='72%' height='16px' rounded={4} />
                    </VStack>
                  ) : (
                    <Text size='sm'>
                      An automated scanner is sending SQL injection payloads in the customer_id
                      filter of the order search endpoint. Early requests returned 500 while the
                      host was in monitoring mode, which suggests the value reaches the database
                      unescaped. Since blocking was enabled every request is rejected, but the
                      parameter should be fixed at the source.
                    </Text>
                  )}
                </VStack>

                <VStack gap={12}>
                  <Heading as='h2' size='md' weight='medium'>
                    Sample request
                  </Heading>
                  {isLoading ? (
                    <Skeleton width='100%' height='160px' rounded={8} />
                  ) : (
                    <CodeSnippetRoot code={SAMPLE_REQUEST} language='text'>
                      <CodeSnippetHeader>
                        <CodeSnippetTitle>Request r-90412 · blocked</CodeSnippetTitle>
                        <CodeSnippetActions>
                          <CodeSnippetWrapButton />
                          <CodeSnippetCopyButton />
                        </CodeSnippetActions>
                      </CodeSnippetHeader>
                      <CodeSnippetContent>
                        <CodeSnippetLineNumbers />
                        <CodeSnippetCode />
                      </CodeSnippetContent>
                    </CodeSnippetRoot>
                  )}
                </VStack>
              </VStack>

              <Card className='h-auto' data-testid='incident-latest-activity'>
                <CardHeader>
                  <CardTitle>Latest activity</CardTitle>
                  <Button
                    variant='ghost'
                    color='neutral'
                    size='small'
                    disabled={isLoading}
                    onClick={handleShowTimeline}
                  >
                    View timeline
                  </Button>
                </CardHeader>
                <CardContent>
                  {isLoading ? (
                    <VStack gap={16}>
                      <Skeleton width='100%' height='40px' rounded={6} />
                      <Skeleton width='100%' height='40px' rounded={6} />
                      <Skeleton width='100%' height='40px' rounded={6} />
                    </VStack>
                  ) : (
                    <Timeline>
                      {TIMELINE.slice(0, 4).map(event => {
                        const Icon = INDICATOR[event.kind].icon;
                        return (
                          <TimelineItem key={event.id}>
                            <TimelineConnector>
                              <TimelineIndicator color={INDICATOR[event.kind].color}>
                                <Icon />
                              </TimelineIndicator>
                              <TimelineSeparator />
                            </TimelineConnector>
                            <TimelineContent>
                              <TimelineTitle>{event.title}</TimelineTitle>
                              <HStack gap={4}>
                                <FormatDateTime
                                  value={event.at}
                                  format='datetime'
                                  layout='inline'
                                />
                                <Text size='sm' color='secondary'>
                                  · {event.actor}
                                </Text>
                              </HStack>
                            </TimelineContent>
                          </TimelineItem>
                        );
                      })}
                    </Timeline>
                  )}
                </CardContent>
              </Card>
            </div>
          </TabsContent>

          <TabsContent value='timeline'>
            <div className='max-w-[720px]'>
              <Timeline data-testid='incident-timeline'>
                {TIMELINE.map(event => {
                  const Icon = INDICATOR[event.kind].icon;
                  return (
                    <TimelineItem key={event.id}>
                      <TimelineConnector>
                        <TimelineIndicator color={INDICATOR[event.kind].color}>
                          <Icon />
                        </TimelineIndicator>
                        <TimelineSeparator />
                      </TimelineConnector>
                      <TimelineContent>
                        <TimelineTitle>{event.title}</TimelineTitle>
                        <TimelineDescription>{event.description}</TimelineDescription>
                        <HStack gap={4}>
                          <FormatDateTime value={event.at} format='datetime' layout='inline' />
                          <Text size='sm' color='secondary'>
                            · {event.actor}
                          </Text>
                        </HStack>
                      </TimelineContent>
                    </TimelineItem>
                  );
                })}
              </Timeline>
            </div>
          </TabsContent>

          <TabsContent value='events'>
            <Table
              aria-label='Related events'
              data={RELATED_EVENTS}
              columns={eventColumns}
              getRowId={getItemId}
              isLoading={isLoading}
              data-testid='incident-events-table'
            />
          </TabsContent>

          <TabsContent value='comments'>
            <VStack gap={24} className='max-w-[720px]' data-testid='incident-comments'>
              {comments.map(comment => (
                <VStack key={comment.id} gap={8}>
                  <HStack justify='between'>
                    <Avatar size='md'>
                      <AvatarFallback name={comment.author} />
                      <AvatarContent>
                        <AvatarName>{comment.author}</AvatarName>
                        <AvatarDescription>{comment.role}</AvatarDescription>
                      </AvatarContent>
                    </Avatar>
                    <FormatDateTime value={comment.at} format='datetime' layout='inline' />
                  </HStack>
                  <Text size='sm'>{comment.body}</Text>
                </VStack>
              ))}
              <VStack gap={12}>
                <Field>
                  <FieldLabel>Add a comment</FieldLabel>
                  <Textarea
                    value={draft}
                    onChange={handleDraftChange}
                    minRows={3}
                    placeholder='Share findings or next steps with the team'
                    data-testid='incident-comment-input'
                  />
                </Field>
                <HStack justify='end'>
                  <Button size='medium' disabled={!draft.trim()} onClick={handleAddComment}>
                    <MessageSquare />
                    Comment
                  </Button>
                </HStack>
              </VStack>
            </VStack>
          </TabsContent>
        </PageContent>
      </Tabs>

      <Dialog
        width={400}
        open={dialogOpen}
        onOpenChange={handleDialogOpenChange}
        data-testid='false-positive-dialog'
      >
        <DialogContent>
          <DialogHeader>
            <DialogTitle>Mark as false positive?</DialogTitle>
            <DialogDescription>
              This closes {INCIDENT.id} and adds a rule exception for {INCIDENT.method}{' '}
              {INCIDENT.path}, so matching requests stop raising incidents. You can reopen it later.
            </DialogDescription>
          </DialogHeader>
          <DialogFooter>
            <DialogClose asChild>
              <Button variant='ghost' color='neutral'>
                Cancel
              </Button>
            </DialogClose>
            <Button
              loading={pending}
              onClick={handleConfirmFalsePositive}
              data-testid='false-positive-confirm'
            >
              Mark as false positive
            </Button>
          </DialogFooter>
        </DialogContent>
      </Dialog>
    </Page>
  );
};
```

## Related

- [Complex drawer](https://wallarm.github.io/design-system/patterns/complex-drawer.md): the same incident in a side panel when the list must stay visible.
- [Resource list page](https://wallarm.github.io/design-system/patterns/resource-list-page.md)
- [Entity table](https://wallarm.github.io/design-system/patterns/entity-table.md)
- [Confirmation dialogs](https://wallarm.github.io/design-system/patterns/confirmation-dialogs.md)
- [Feedback toasts](https://wallarm.github.io/design-system/patterns/feedback-toasts.md)
- [Application layout](https://wallarm.github.io/design-system/patterns/app-layout.md): the shell and breadcrumbs around this page.
