Files
ServerKit/frontend/src/components/QuickCreate.jsx
T
Juan Denis 611dcdc00c Normalize UI copy: sentence case, no em dashes or filler
1,250 strings across 223 files, edited at their inline English
defaults (en.json regenerated, keys unchanged):
- sentence case for buttons, titles, labels, tabs and nav (827),
  with an allowlist of product names and acronyms
- every em dash rewritten (184); "successfully", neutral "!" and
  short-toast periods dropped; helper sentences end with a period
- "Are you sure?" confirms now state the consequence; "Danger Zone",
  "no going back", "to get started" and "You're all set" gone
- straight quotes, "…", "time zone", unit spacing, "and" for "&"
- Confirm/Cancel and four other hardcoded labels wrapped in t()

scripts/copy-rewrite.mjs applies a {key: English} map at every call
site; the glossary pass reuses it.
2026-10-04 04:30:42 -04:00

30 lines
1.3 KiB
React

import { Plus } from 'lucide-react';
import { cn } from '@/lib/utils';
import { useTranslation } from 'react-i18next';
import { Button as SharedButton } from '@/components/ui/button';
// Global quick-create (the "+" button beside the brand). It used to carry its
// own little dropdown; now it opens the command palette, whose empty state
// leads with the Create tile grid (see data/createItems.js) plus recipes and
// search — one door for every "new thing" flow. DashboardLayout listens for
// the event because the palette's open state lives there.
export function QuickCreate({ className, variant = 'icon' }) {
const { t } = useTranslation();
// 'icon' — compact square button (mobile top bar). 'header' — the accent
// create button beside the ServerKit mark and GitHub star.
const header = variant === 'header';
return (
<SharedButton variant="unstyled"
type="button"
className={cn('quick-create', header && 'quick-create--header', className)}
title={t('app.quickCreate.createOrSearch', 'Create or search (Ctrl K)')}
aria-label={t('app.quickCreate.createNew2', 'Create new')}
onClick={() => window.dispatchEvent(new CustomEvent('serverkit:open-palette'))}
>
<Plus size={header ? 15 : 16} />
</SharedButton>
);
}
export default QuickCreate;