Extract component for ProbChangeRow
This commit is contained in:
parent
a06c659cc8
commit
5219a63667
|
@ -35,40 +35,33 @@ export function ProbChangeTable(props: {
|
||||||
<Col className="mb-4 w-full divide-x-2 divide-y rounded-lg bg-white shadow-md md:flex-row md:divide-y-0">
|
<Col className="mb-4 w-full divide-x-2 divide-y rounded-lg bg-white shadow-md md:flex-row md:divide-y-0">
|
||||||
<Col className="flex-1 divide-y">
|
<Col className="flex-1 divide-y">
|
||||||
{filteredPositiveChanges.map((contract) => (
|
{filteredPositiveChanges.map((contract) => (
|
||||||
<Row className="items-center hover:bg-gray-100">
|
<ProbChangeRow key={contract.id} contract={contract} />
|
||||||
<ProbChange
|
|
||||||
className="p-4 text-right text-xl"
|
|
||||||
contract={contract}
|
|
||||||
/>
|
|
||||||
<SiteLink
|
|
||||||
className="p-4 pl-2 font-semibold text-indigo-700"
|
|
||||||
href={contractPath(contract)}
|
|
||||||
>
|
|
||||||
<span className="line-clamp-2">{contract.question}</span>
|
|
||||||
</SiteLink>
|
|
||||||
</Row>
|
|
||||||
))}
|
))}
|
||||||
</Col>
|
</Col>
|
||||||
<Col className="flex-1 divide-y">
|
<Col className="flex-1 divide-y">
|
||||||
{filteredNegativeChanges.map((contract) => (
|
{filteredNegativeChanges.map((contract) => (
|
||||||
<Row className="items-center hover:bg-gray-100">
|
<ProbChangeRow key={contract.id} contract={contract} />
|
||||||
<ProbChange
|
|
||||||
className="p-4 text-right text-xl"
|
|
||||||
contract={contract}
|
|
||||||
/>
|
|
||||||
<SiteLink
|
|
||||||
className="p-4 pl-2 font-semibold text-indigo-700"
|
|
||||||
href={contractPath(contract)}
|
|
||||||
>
|
|
||||||
<span className="line-clamp-2">{contract.question}</span>
|
|
||||||
</SiteLink>
|
|
||||||
</Row>
|
|
||||||
))}
|
))}
|
||||||
</Col>
|
</Col>
|
||||||
</Col>
|
</Col>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ProbChangeRow(props: { contract: CPMMContract }) {
|
||||||
|
const { contract } = props
|
||||||
|
return (
|
||||||
|
<Row className="items-center hover:bg-gray-100">
|
||||||
|
<ProbChange className="p-4 text-right text-xl" contract={contract} />
|
||||||
|
<SiteLink
|
||||||
|
className="p-4 pl-2 font-semibold text-indigo-700"
|
||||||
|
href={contractPath(contract)}
|
||||||
|
>
|
||||||
|
<span className="line-clamp-2">{contract.question}</span>
|
||||||
|
</SiteLink>
|
||||||
|
</Row>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
export function ProbChange(props: {
|
export function ProbChange(props: {
|
||||||
contract: CPMMContract
|
contract: CPMMContract
|
||||||
className?: string
|
className?: string
|
||||||
|
|
Loading…
Reference in New Issue
Block a user