feat(odin): personalized greeting hero on the new-conversation screen
Time-based Czech greeting + the user's first name (e.g. "Dobrý večer, Admin") above the big gradient "Odin" wordmark, with a stylish description line. Drop the redundant mark from the hero (it lives on the nav item + thinking state). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -62,10 +62,26 @@ function summaryNote(reviews: ReviewInvoice[]): string {
|
||||
export default function OdinChat() {
|
||||
const alert = useAlert();
|
||||
const qc = useQueryClient();
|
||||
const { hasPermission } = useAuth();
|
||||
const { user, hasPermission } = useAuth();
|
||||
// Saving an extracted invoice hits /received-invoices (needs invoices.create);
|
||||
// Odin itself only needs ai.use, so the Save affordance is gated separately.
|
||||
const canSave = hasPermission("invoices.create");
|
||||
// Time-based Czech greeting + the user's first name (client-local time).
|
||||
const greeting = (() => {
|
||||
const h = new Date().getHours();
|
||||
const part =
|
||||
h < 9
|
||||
? "Dobré ráno"
|
||||
: h < 12
|
||||
? "Dobrý den"
|
||||
: h < 18
|
||||
? "Dobré odpoledne"
|
||||
: "Dobrý večer";
|
||||
const name = (user?.fullName || user?.username || "")
|
||||
.trim()
|
||||
.split(/\s+/)[0];
|
||||
return name ? `${part}, ${name}` : part;
|
||||
})();
|
||||
const { data: usage } = useQuery(aiUsageOptions());
|
||||
const { data: convData, isPending: convPending } = useQuery(
|
||||
aiConversationsOptions(),
|
||||
@@ -425,6 +441,7 @@ export default function OdinChat() {
|
||||
turns={turns}
|
||||
busy={busy}
|
||||
loading={messagesLoading}
|
||||
greeting={greeting}
|
||||
threadRef={threadRef}
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user