mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-14 21:26:08 +01:00
21 lines
440 B
Plaintext
21 lines
440 B
Plaintext
---
|
|||
|
|
import { Link } from "./Link";
|
||
|
|
import { Text } from "./Text";
|
||
|
|
|
||
|
|
interface Props {
|
||
|
|
value: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
const bodyPattern = /^([a-z0-9-\/\.]+) (.+)$/;
|
||
|
|
const { value } = Astro.props;
|
||
|
|
const match = value.match(bodyPattern);
|
||
|
|
|
||
|
|
if (match === null) {
|
||
|
|
throw new Error(`Invalid value for ApiMacroSee: ${value}`);
|
||
|
|
}
|
||
|
|
|
||
|
|
const path = match[1];
|
||
|
|
const message = match[2];
|
||
|
|
---
|
||
|
|
|
||
|
|
<Text><Text color="tomato">See</Text> <Link>{path}</Link> {message}</Text>
|