refactor molecule components to use .withProps() subcomponents and extract inline code
- Add UnstyledButton listItem theme variant to replace inline style for border-radius - Extract subcomponent constants with .withProps() across all molecules - Replace raw <span /> with Mantine <Flex /> in ResourcePreviewPanel - Extract inline template literals and expressions to named functions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
04c23094a4
commit
27186c2ff7
1 changed files with 666 additions and 356 deletions
|
|
@ -19,6 +19,30 @@ export interface ElicitationUrlPanelProps {
|
|||
onCancel: () => void;
|
||||
}
|
||||
|
||||
const ItalicMessage = Text.withProps({
|
||||
size: "md",
|
||||
fs: "italic",
|
||||
});
|
||||
|
||||
const WrappingCode = Code.withProps({
|
||||
block: true,
|
||||
variant: "wrapping",
|
||||
});
|
||||
|
||||
const HintText = Text.withProps({
|
||||
size: "sm",
|
||||
c: "dimmed",
|
||||
});
|
||||
|
||||
const MetaText = Text.withProps({
|
||||
size: "xs",
|
||||
c: "dimmed",
|
||||
});
|
||||
|
||||
function formatElicitationId(id: string): string {
|
||||
return `Elicitation ID: ${id}`;
|
||||
}
|
||||
|
||||
export function ElicitationUrlPanel({
|
||||
message,
|
||||
url,
|
||||
|
|
@ -30,14 +54,10 @@ export function ElicitationUrlPanel({
|
|||
}: ElicitationUrlPanelProps) {
|
||||
return (
|
||||
<Stack gap="md">
|
||||
<Text size="md" fs="italic">
|
||||
{message}
|
||||
</Text>
|
||||
<ItalicMessage>{message}</ItalicMessage>
|
||||
<Divider />
|
||||
<Text size="sm">The server is requesting you visit:</Text>
|
||||
<Code block variant="wrapping">
|
||||
{url}
|
||||
</Code>
|
||||
<WrappingCode>{url}</WrappingCode>
|
||||
<Group>
|
||||
<Button variant="light" onClick={onCopyUrl}>
|
||||
Copy URL
|
||||
|
|
@ -50,14 +70,10 @@ export function ElicitationUrlPanel({
|
|||
{isWaiting && (
|
||||
<Group>
|
||||
<Loader size="sm" />
|
||||
<Text size="sm" c="dimmed">
|
||||
Waiting for completion...
|
||||
</Text>
|
||||
<HintText>Waiting for completion...</HintText>
|
||||
</Group>
|
||||
)}
|
||||
<Text size="xs" c="dimmed">
|
||||
Elicitation ID: {elicitationId}
|
||||
</Text>
|
||||
<MetaText>{formatElicitationId(elicitationId)}</MetaText>
|
||||
<Alert color="yellow" title="Warning">
|
||||
This will open an external URL. Verify the domain before proceeding.
|
||||
</Alert>
|
||||
|
|
|
|||
Loading…
Reference in a new issue