aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/app/components/stop/StopUsageModal.tsx
blob: 0b0cff39f76ca9b8c28a7cb1281344db67337c8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { Sheet } from "react-modal-sheet";
import type { BusStopUsagePoint } from "~/api/schema";
import { StopUsageChart } from "./StopUsageChart";

interface StopUsageModalProps {
  isOpen: boolean;
  onClose: () => void;
  usage: BusStopUsagePoint[];
}

export const StopUsageModal = ({
  isOpen,
  onClose,
  usage,
}: StopUsageModalProps) => {
  return (
    <Sheet isOpen={isOpen} onClose={onClose} detent="content">
      <Sheet.Container className="bg-white! dark:bg-black! !rounded-t-[20px]">
        <Sheet.Header className="bg-white! dark:bg-black! !rounded-t-[20px]" />
        <Sheet.Content className="p-6 pb-12">
          <StopUsageChart usage={usage} />
        </Sheet.Content>
      </Sheet.Container>
      <Sheet.Backdrop onTap={onClose} />
    </Sheet>
  );
};