-
Notifications
You must be signed in to change notification settings - Fork 160
/
index.tsx
27 lines (26 loc) · 904 Bytes
/
index.tsx
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 { FC } from "react";
import { Photon, PhotonVersion } from "@lepton-dashboard/interfaces/photon";
import { Description } from "@lepton-dashboard/components/description";
import { CarbonIcon } from "@lepton-dashboard/components/icons";
import { Time } from "@carbon/icons-react";
import { Link } from "@lepton-dashboard/components/link";
import { DateParser } from "@lepton-dashboard/components/date-parser";
export const TimeDescription: FC<{
versions?: PhotonVersion[];
photon: Photon;
detail: boolean;
}> = ({ versions, photon }) => {
return (
<Description.Item
icon={<CarbonIcon icon={<Time />} />}
description={
<Link to={`/photons/detail/${photon.id}`} relative="route">
<DateParser
prefix={versions && versions.length > 1 ? "Updated" : "Created"}
date={photon.created_at}
/>
</Link>
}
/>
);
};