diff --git a/src/components/GregCoreRandomSnippet.tsx b/src/components/GregCoreRandomSnippet.tsx
new file mode 100644
index 0000000..9ba16b8
--- /dev/null
+++ b/src/components/GregCoreRandomSnippet.tsx
@@ -0,0 +1,61 @@
+import React, {useMemo} from 'react';
+import BrowserOnly from '@docusaurus/BrowserOnly';
+import {GREG_CORE_SNIPPETS} from '../data/gregCoreSnippets';
+
+type Props = {
+ /** e.g. "Random sample from gregCore" */
+ caption: string;
+};
+
+/**
+ * Picks one snippet per client mount (stable for that visit; no SSR/CSR mismatch).
+ */
+function GregCoreRandomSnippetInner({caption}: Props): JSX.Element {
+ const snippet = useMemo(
+ () => GREG_CORE_SNIPPETS[Math.floor(Math.random() * GREG_CORE_SNIPPETS.length)],
+ [],
+ );
+
+ return (
+
+
+
+
+
{caption}
+
+ {snippet.title}
+ ·
+ {snippet.sourcePath}
+
+
+
+
+
+ {snippet.code.trimEnd()}
+
+
+
+ );
+}
+
+export function GregCoreRandomSnippet(props: Props): JSX.Element {
+ return (
+
+
+ Loading code sample…
+
+
+ }>
+ {() => }
+
+ );
+}
diff --git a/src/data/gregCoreSnippets.ts b/src/data/gregCoreSnippets.ts
new file mode 100644
index 0000000..54905af
--- /dev/null
+++ b/src/data/gregCoreSnippets.ts
@@ -0,0 +1,118 @@
+/**
+ * Short excerpts from gregCore (gregFramework monorepo) for the homepage.
+ * Kept in sync conceptually with Core/ and Hooks/ — adjust if APIs move.
+ */
+export type GregCoreSnippet = {
+ /** Short title for the card header */
+ title: string;
+ /** Path inside the gregFramework repo */
+ sourcePath: string;
+ code: string;
+};
+
+export const GREG_CORE_SNIPPETS: readonly GregCoreSnippet[] = [
+ {
+ title: 'GregHookName',
+ sourcePath: 'gregCore/Core/GregHookName.cs',
+ code: `public static string Create(GregDomain domain, string action)
+ => Create(domain, action, null);
+
+public static string Create(GregDomain domain, string action, string subject)
+{
+ if (string.IsNullOrWhiteSpace(action))
+ throw new ArgumentException("Action ist erforderlich.", nameof(action));
+ // → greg.PLAYER.MoneyChanged, greg.EMPLOYEE.Hired, …
+ var domainPart = DomainToSegment(domain);
+ // …
+}`,
+ },
+ {
+ title: 'GregDomain',
+ sourcePath: 'gregCore/Core/GregDomain.cs',
+ code: `public enum GregDomain
+{
+ Gameplay,
+ Player,
+ Employee,
+ Customer,
+ Server,
+ Rack,
+ Network,
+ Power,
+ Ui,
+ System
+}`,
+ },
+ {
+ title: 'GregEventDispatcher',
+ sourcePath: 'gregCore/Core/GregEventDispatcher.cs',
+ code: `public static void On(string hookName, Action