refactor(base): simplify draft banner to inline Reset/Save controls

This commit is contained in:
Philipinho
2026-04-20 23:12:51 +01:00
parent ae595c51ed
commit cfb02766e2
@@ -1,5 +1,4 @@
import { Paper, Group, Text, Button } from "@mantine/core";
import { IconInfoCircle } from "@tabler/icons-react";
import { Group, Button, Tooltip } from "@mantine/core";
import { useTranslation } from "react-i18next";
type BaseViewDraftBannerProps = {
@@ -20,25 +19,27 @@ export function BaseViewDraftBanner({
const { t } = useTranslation();
if (!isDirty) return null;
return (
<Paper withBorder radius="sm" px="md" py="xs" bg="yellow.0">
<Group justify="space-between" wrap="nowrap">
<Group gap="xs" wrap="nowrap">
<IconInfoCircle size={16} />
<Text size="sm">
{t("Filter and sort changes are visible only to you.")}
</Text>
</Group>
<Group gap="sm" wrap="nowrap">
<Button variant="subtle" color="gray" size="xs" onClick={onReset}>
{t("Reset")}
<Group justify="flex-end" gap="xs" px="md" py={6} wrap="nowrap">
<Button variant="subtle" color="gray" size="xs" onClick={onReset}>
{t("Reset")}
</Button>
{canSave && (
<Tooltip
label={t("Filter and sort changes are visible only to you")}
position="bottom"
withArrow
>
<Button
variant="light"
color="orange"
size="xs"
onClick={onSave}
loading={saving}
>
{t("Save for everyone")}
</Button>
{canSave && (
<Button size="xs" onClick={onSave} loading={saving}>
{t("Save for everyone")}
</Button>
)}
</Group>
</Group>
</Paper>
</Tooltip>
)}
</Group>
);
}