Admin section updates.

This commit is contained in:
Mike Cao 2025-07-10 20:04:17 -07:00
parent 87449ece9e
commit 1b81074752
20 changed files with 274 additions and 647 deletions

View file

@ -6,17 +6,13 @@ import {
Switch,
FormSubmitButton,
Column,
Icon,
Grid,
Label,
useToast,
TooltipTrigger,
Tooltip,
Row,
} from '@umami/react-zen';
import { useState } from 'react';
import { getRandomChars } from '@/lib/crypto';
import { useApi, useMessages, useModified } from '@/components/hooks';
import { Refresh } from '@/components/icons';
const generateId = () => getRandomChars(16);
@ -70,24 +66,19 @@ export function WebsiteShareForm({ websiteId, shareId, onSave, onClose }: Websit
{id && (
<Column>
<Label>{formatMessage(labels.shareUrl)}</Label>
<Grid columns="1fr auto" gap>
<TextField value={url} isReadOnly allowCopy />
<TooltipTrigger>
<Button onPress={handleGenerate} variant="quiet" size="sm">
<Icon>
<Refresh />
</Icon>
</Button>
<Tooltip>{formatMessage(labels.regenerate)}</Tooltip>
</TooltipTrigger>
</Grid>
<TextField value={url} isReadOnly allowCopy />
</Column>
)}
<FormButtons>
<Button onPress={onClose}>{formatMessage(labels.cancel)}</Button>
<FormSubmitButton isDisabled={false} isLoading={isPending}>
{formatMessage(labels.save)}
</FormSubmitButton>
<FormButtons justifyContent="space-between">
<Row>
{id && <Button onPress={handleGenerate}>{formatMessage(labels.regenerate)}</Button>}
</Row>
<Row>
{onClose && <Button onPress={onClose}>{formatMessage(labels.cancel)}</Button>}
<FormSubmitButton isDisabled={false} isLoading={isPending}>
{formatMessage(labels.save)}
</FormSubmitButton>
</Row>
</FormButtons>
</Column>
</Form>