Files
pingvin-share/frontend/src/components/account/showShareLinkModal.tsx
2023-08-17 14:47:58 +02:00

23 lines
615 B
TypeScript

import { Stack, TextInput } from "@mantine/core";
import { ModalsContextProps } from "@mantine/modals/lib/context";
import { translateOutsideContext } from "../../hooks/useTranslate.hook";
const showShareLinkModal = (
modals: ModalsContextProps,
shareId: string,
appUrl: string,
) => {
const t = translateOutsideContext();
const link = `${appUrl}/s/${shareId}`;
return modals.openModal({
title: t("account.shares.modal.share-link"),
children: (
<Stack align="stretch">
<TextInput variant="filled" value={link} />
</Stack>
),
});
};
export default showShareLinkModal;