-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add links to product and count of insights (#1088)
- Loading branch information
1 parent
a4d2aef
commit a8e5f7b
Showing
3 changed files
with
70 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import * as React from "react"; | ||
import Stack, { StackProps } from "@mui/material/Stack"; | ||
import Button from "@mui/material/Button"; | ||
import Link from "@mui/material/Link"; | ||
import EditIcon from "@mui/icons-material/Edit"; | ||
import VisibilityIcon from "@mui/icons-material/Visibility"; | ||
import { useTranslation } from "react-i18next"; | ||
import offService from "../../off"; | ||
import { Typography } from "@mui/material"; | ||
|
||
export default function LinkToProduct( | ||
props: { barcode: string; count: number } & StackProps, | ||
) { | ||
const { barcode, count, ...other } = props; | ||
|
||
const { t } = useTranslation(); | ||
return ( | ||
<Stack direction="row" alignItems="center" {...other}> | ||
<Button | ||
size="small" | ||
component={Link} | ||
target="_blank" | ||
href={offService.getProductUrl(barcode)} | ||
variant="outlined" | ||
startIcon={<VisibilityIcon />} | ||
sx={{ minWidth: 150 }} | ||
> | ||
{t("questions.view")} | ||
</Button> | ||
<Button | ||
size="small" | ||
component={Link} | ||
target="_blank" | ||
href={offService.getProductEditUrl(barcode)} | ||
variant="contained" | ||
startIcon={<EditIcon />} | ||
sx={{ ml: 2, minWidth: 150 }} | ||
> | ||
{t("questions.edit")} | ||
</Button> | ||
<Typography sx={{ ml: "auto" }}>Restant: {count}</Typography> | ||
</Stack> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters