Files
v10/site/src/components/docs/api-reference/ApiStateTable.astro
T
2026-03-06 16:19:27 -06:00

45 lines
1.0 KiB
Plaintext

---
/**
* Renders the state interface table for API reference.
*/
import Table from '@/components/typography/Table.astro';
import Tbody from '@/components/typography/Tbody.astro';
import Th from '@/components/typography/Th.astro';
import Thead from '@/components/typography/Thead.astro';
import Tr from '@/components/typography/Tr.astro';
import type { StateDef } from '@/types/component-reference';
import StateRow from './StateRow.astro';
interface Props {
state: Record<string, StateDef>;
componentName: string;
}
const { state, componentName } = Astro.props;
const stateEntries = Object.entries(state);
---
<Table maxWidth={false} outerClass="my-6">
<Thead>
<Tr>
<Th>Property</Th>
<Th>Type</Th>
<Th />
</Tr>
</Thead>
<Tbody>
{
stateEntries.map(([name, def]) => (
<StateRow
name={name}
type={def.type}
detailedType={def.detailedType}
description={def.description}
componentName={componentName}
/>
))
}
</Tbody>
</Table>