---
interface Props {
code: string;
hints: string[];
}
const { code, hints } = Astro.props;
const id = `dv-${Math.random().toString(36).substring(2, 9)}`;
const lines = code.split('\n');
---
{Astro.url.pathname.split('/').pop() || 'file.js'}
{lines.map((line, index) => {
const lineNum = index + 1;
const hasHint = hints.some(h => h.includes(`Line ${lineNum}`));
const hintText = hints.find(h => h.includes(`Line ${lineNum}`));
return (
|
{lineNum}
|
{line || ' '}
{hasHint && (
• {hintText?.replace(`Line ${lineNum}: `, '')}
)}
|
);
})}
{hints.length > 0 && (
Hints:
{hints.map((hint) => (
-
•
{hint}
))}
)}