|
| 1 | +import { useQuery } from "@tanstack/react-query" |
| 2 | +import { getLicenses } from "api/api" |
| 3 | +import { Stack } from "components/Stack/Stack" |
| 4 | +import { FC } from "react" |
| 5 | +import { Helmet } from "react-helmet-async" |
| 6 | +import { pageTitle } from "utils/page" |
| 7 | +import { License } from "api/typesGenerated" |
| 8 | +import { Header } from "components/DeploySettingsLayout/Header" |
| 9 | +import { Button, Card, CardContent, Typography } from "@material-ui/core" |
| 10 | +import dayjs from "dayjs" |
| 11 | +import { PageHeader, PageHeaderSubtitle, PageHeaderTitle } from "components/PageHeader/PageHeader" |
| 12 | +import { PlusOneOutlined } from "@material-ui/icons" |
| 13 | + |
| 14 | +const LicensesSettingsPage: FC = () => { |
| 15 | + const { data: licenses, isLoading } = useQuery({ |
| 16 | + queryKey: ["licenses"], |
| 17 | + queryFn: () => getLicenses() |
| 18 | + }) |
| 19 | + |
| 20 | + console.log(licenses) |
| 21 | + |
| 22 | + |
| 23 | + return ( |
| 24 | + <> |
| 25 | + <Helmet> |
| 26 | + <title>{pageTitle("General Settings")}</title> |
| 27 | + </Helmet> |
| 28 | + <Stack alignItems="baseline" direction="row" justifyContent="space-between"> |
| 29 | + <Header |
| 30 | + title="Licenses" |
| 31 | + description="Add a license to your account to unlock more features." |
| 32 | + /> |
| 33 | + |
| 34 | + <Button |
| 35 | + component="a" |
| 36 | + target="_blank" |
| 37 | + > |
| 38 | + Add a license |
| 39 | + </Button> |
| 40 | + |
| 41 | + </Stack> |
| 42 | + |
| 43 | + <Stack spacing={4}> |
| 44 | + {licenses?.map((license) => ( |
| 45 | + <Card key={license.id}> |
| 46 | + <CardContent> |
| 47 | + <Typography color="textSecondary" variant="h4"> |
| 48 | + #{license.id} |
| 49 | + </Typography> |
| 50 | + {/* <p>{dayjs.unix(license.claims.license_expires).toISOString()}</p> |
| 51 | + <p>{license.claims.trial}</p> |
| 52 | + <p>{license.claims.account_type}</p> */} |
| 53 | + </CardContent> |
| 54 | + </Card> |
| 55 | + ))} |
| 56 | + </Stack> |
| 57 | + </> |
| 58 | + ) |
| 59 | +} |
| 60 | + |
| 61 | +export default LicensesSettingsPage |
0 commit comments