docs(frontend): document skills marketplace + packs data-flow
This commit is contained in:
@@ -48,6 +48,12 @@ const extractErrorMessage = (error: unknown, fallback: string) => {
|
||||
return fallback;
|
||||
};
|
||||
|
||||
/**
|
||||
* Form used for creating/editing a marketplace skill source.
|
||||
*
|
||||
* Intentionally keeps validation lightweight + client-side only:
|
||||
* the backend remains the source of truth and returns actionable errors.
|
||||
*/
|
||||
export function MarketplaceSkillForm({
|
||||
initialValues,
|
||||
sourceUrlReadOnly = false,
|
||||
@@ -80,6 +86,13 @@ export function MarketplaceSkillForm({
|
||||
);
|
||||
const [errorMessage, setErrorMessage] = useState<string | null>(null);
|
||||
|
||||
/**
|
||||
* Basic repo URL validation.
|
||||
*
|
||||
* This is strict by design (https + github.com + at least owner/repo)
|
||||
* to catch obvious mistakes early. More complex URLs (subpaths, branches)
|
||||
* are handled server-side.
|
||||
*/
|
||||
const isValidSourceUrl = (value: string) => {
|
||||
try {
|
||||
const parsed = new URL(value);
|
||||
|
||||
@@ -26,6 +26,13 @@ export const SKILLS_TABLE_EMPTY_ICON = (
|
||||
</svg>
|
||||
);
|
||||
|
||||
/**
|
||||
* Small helper for supporting both controlled and uncontrolled table sorting.
|
||||
*
|
||||
* TanStack Table expects a `sorting` state + `onSortingChange` callback.
|
||||
* Some pages want to control this from the URL (shareable links), while others
|
||||
* are fine letting the table manage it internally.
|
||||
*/
|
||||
export const useTableSortingState = (
|
||||
sorting: SortingState | undefined,
|
||||
onSortingChange: OnChangeFn<SortingState> | undefined,
|
||||
|
||||
Reference in New Issue
Block a user