fix: correct V13 and public presentation patterns in isolated QA
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { publicReference } from '@/lib/public-presentation';
|
||||
export default function PublicReference({ value }: { value?: string | null }) {
|
||||
const text = publicReference(value);
|
||||
if (!text) return null;
|
||||
if (/^https?:\/\//i.test(text))
|
||||
return (
|
||||
<a
|
||||
className="underline"
|
||||
href={text}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
Consultar fonte — {new URL(text).hostname}
|
||||
</a>
|
||||
);
|
||||
return <>{text}</>;
|
||||
}
|
||||
Reference in New Issue
Block a user