Files
example/web/ExampleDetail.tsx
pastilhasandClaude Opus 5 176fb19950 example, extracted from the platform into its own repository
The reference plugin — deliberately the smallest thing that is still a real
plugin, and what EXTRACTING-A-PLUGIN.md sends people to read.

It leaves the platform tree with music and offscale, so that `plugins/` in the
platform repository holds documentation and nothing else. That is the point of
the move: a directory that contains both tracked source and untracked installs
is one where "is this mine or is this installed" has no answer you can see.

Same extraction as the two before it: source only, no history. The platform's
history still holds every commit that shaped this.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-15 18:17:03 +00:00

24 lines
966 B
TypeScript

import { useParams } from 'react-router';
// The second panel, reading the URL rather than being told by its sibling.
//
// The shell registers `<prefix>` and `<prefix>/:section`, so a plugin's sections are addressable,
// linkable and cmd-clickable — the same convention every core screen follows. Panels read `useParams`
// independently; nothing is passed between them, so they cannot disagree.
export const ExampleDetail = () => {
const { section } = useParams();
return (
<div className="h-full overflow-auto p-6">
<h2 className="text-lg font-semibold text-duck-dark">Detail</h2>
<p className="mt-1 text-sm text-duck-dark/60">
Section from the URL: <code>{section ?? '(none)'}</code>
</p>
<p className="mt-3 text-xs text-duck-dark/40">
Try <code>/example/anything</code> this panel reads it from <code>useParams</code>, with no state passed from
the panel beside it.
</p>
</div>
);
};